To apply a CSS Class to a form generated by the Form Helper in CakePHP see the example below
1. To add a class to a form tag:
echo $this->Form->create('User', array('class'=>'form'))
2. To add a class to a input tag:
echo $this->Form->input('username', array('class' => 'form-control','placeholder'=>'Enter user name'));
3. To add a class to a button tag:
<?php echo $this->Form->end('Login',array('class'=>'btn-theme btn-block')); ?> //code 1
or
<?php echo $this->Form->submit('Submit', array('class' => 'btn-theme btn-block')); ?> // 2nd code
//Both code 1 & 2 is used to create submit button in cake php but, if CSS class doesn't work in Code 1 then Use code 2 to create Button.
0 Comment(s)