Form->end without a div in CakePHP
I'd like to create a submit button that does NOT have a <div>
around it. I assumed using the inputDefaults
would make this happen like it does for all of the forms inputs, but - no luck.
Obviously I could just create a submit button via HTML, wit开发者_JS百科hout CakePHP, but - I was hoping there'd be a cake answer. Here's what I've tried:
$this->Form->create(false, array('inputDefaults' => array('div'=>false)));
$this->Form->end('Submit');
echo $this->Form->submit('Submit', array('div'=>false));
Should do what you are after. The other example may have been Cake 1.2 or something; not sure.
It also appears you can just do this instead:
<?php
$options = array(
'label' => 'Update',
'value' => 'Update!',
'div' => false
)
);
echo $this->Form->end($options);
That looks more cakey.
精彩评论