Reputation: 8283
I know you can define inputDefaults in the Form->create
function, but if I define the label class
there, and set the text
in the individual Form->input
function, the class
option is removed. Is there any way around this or do I have to re-define the label option completely?
Upvotes: 0
Views: 113
Reputation: 4177
Yes, you've to redefine the label option completely.
$this->Form->input('name', array(
'label' => array(
'text' => __('label-text'),
'class' => 'label-class'
)
));
your default options are overridden by the options that you've specified for the input method of form helper.
For more information check __parseOptions
Upvotes: 1