To get post data, use debug
debug($this->request->getData());
It's looking like you need all CRUD code.
So, you can create your user add.ctp file below
location : templates\Users\add.ctp
<?= $this->Form->create($user) ?>
<?php
echo $this->Form->control('username');
echo $this->Form->control('email');
echo $this->Form->control('password');
?>
<?= $this->Form->button(__('Submit')) ?>
<?= $this->Form->end() ?>
Then users controller look like
UsersController/add method look like
public function add()
{
$user = $this->Users->newEmptyEntity();
if ($this->request->is('post')) {
$user = $this->Users->patchEntity($user, $this->request->getData());
if ($this->Users->save($user)) {
$this->Flash->success(__('The user has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The user could not be saved. Please, try again.'));
}
$this->set(compact('user'));
}
Do you need more ?
Just need to give a simple command in your app folder to generate your CRUD.
give command
bin/cake bake all users
Assumption, users is your database table name.
Then you will get add,edit,delete,view.
can see this tutorial for see how to give cake bake command