Das Handbuch»Entwickeln mit CakePHP»Controllers»Controller-Attribute»Das Parameter-Attribut ($params)»data
3.5.2.4.8 data
$this->data
$this->data
Used to handle POST data sent from the FormHelper forms to the controller.
<?php
// The FormHelper is used to create a form element:
$form->text('User.first_name');
// When rendered, it looks something like:
<input name="data[User][first_name]" value="" type="text" />
// When the form is submitted to the controller via POST,
// the data shows up in $this->data.
//The submitted first name can be found here:
$this->data['User']['first_name'];
?>
<?php// The FormHelper is used to create a form element:$form->text('User.first_name');// When rendered, it looks something like:<input name="data[User][first_name]" value="" type="text" />// When the form is submitted to the controller via POST,// the data shows up in $this->data.//The submitted first name can be found here:$this->data['User']['first_name'];?>
See comment for this section
