Reputation: 1445
I have set up my CakePHP installation with Bootstrap 3 using BoostCake.
Now, what I would like would be to create a view like the following Bootstrap sign in example: http://getbootstrap.com/examples/signin/
How do I integrate this bootstrap layout using the Formhelper in CakePHP?
For example: In regular CakePHP I would do the following to create a login button:
<?php echo $this->Form->end('Login', array('type' => 'submit')) ?>
However that won't produce the nice blue login button, so instead I can do this:
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
<?php echo $this->Form->end() ?>
So if I have a login text field:
<?php echo $this->Form->input('User.username'); ?>
How can I transform that to use the textbox visual in the signin example while still using the formhelper?
Thanks in advance.
Upvotes: 2
Views: 1969
Reputation: 5271
You can put the classes in the options array. For instance, your submit method could change to:
<?php
echo $this->Form->submit('Sign In',array(
'class' => 'btn btn-lg btn-primary btn-block',
'div' => false));
?>
The input
method also allows for the options array for your login text field.
Upvotes: 2