When I type a text in the input and click save changes I want to get the value in the controller.
<form action="/lms/dashboard/index" method="post" enctype="multipart/form-data">
<input id='name' name='name' type="text">
<button type="submit" id="btnSubmit" value="submit" >Save Changes</button>
public function index() {
$hasvalue = $this->_params['name'];
if(!empty($hasvalue))
{
pr(' param found');
}
}
You can access your form data in your controller action by calling the following method:
You can see more details about handling request and response in CakePHP here: https://book.cakephp.org/3.0/en/controllers/request-response.html#