Вопрос

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