I am in need of all the arrays and subarrays for a form element. When referred cookbook, I found only the subarrays for limited elements. For example,

<?php
    echo $this->Form->input('name', array(
    'div' => array(
        'id' => 'mainDiv',
        'title' => 'Div Title',
        'style' => 'display:block'
    )
));
 ?>

Here in this form helper, we can get only arrays like id, title, style.But I am in need of all the possible array keys for form elements. How can we get this?

有帮助吗?

解决方案

You can set common properties of any form while creating it like below which will be applicable for all form elements

    echo $this->Form->create('my_form', , array(
'inputDefaults' => array(
    'label' => false,
    'div' => false
));

Now the label and div will not appear to any form element you gonna use, This is how you can create common set of array for all form element under it..

Hope this will help u

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top