Using CakePHP 1.3, I post a form which correctly fills in $this->data. According to the docs, it seems like $this->params['form'] should be populated with some information as well, but it’s simply an empty array. Is there a particular reason for that?
The form is built using the Form Helper, as follows…
Some relevant code:
$default_form_create_options = array(
'inputDefaults' => array(
'label'=>false,
'div'=>false
)
);
echo $form->create('Preappform', $default_form_create_options);
// --- snip, a bunch of form elements created via $form->input()
echo $form->end(array('label'=>'Send This Form »', 'class'=>'submit-button', 'escape'=>false));
I know that the form data is available in $this->data, so maybe this is just a documentation/curiosity issue. If so… my bad.
Just for giggles try
$this->params['data']. I don’t know why but for some reason it shows form data in there for me.The documentation has conflicting data as you can see here http://book.cakephp.org/view/972/data. I am guessing that if you use the FormHelper it will show up in
$this->dataand if you don’t use the FormHelper it will show up in$this->params['form'].Notice if you use FormHelper the name of the element will be
data['Model']['element_name']and if you just create the form manually you can name it ‘element_name’. By doing the later I believe it throws it into theparams['form']instead of the$this->data.