0

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?

3
  • Can you please elaborate weather you want all the possible array for wrapping div of input box or you just need array which can add property to input box? Commented Aug 13, 2013 at 6:49
  • I am looking for array that can be applicable for all form elements. Is such option available in Cake? Commented Aug 13, 2013 at 7:01
  • I don't quite understand your question, but are you looking for some form of form helper global configuration, because it doesn't exist. You'd have to write your own helper. Commented Aug 13, 2013 at 8:01

1 Answer 1

0

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.