Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to apply CSS style in CakePHP ?

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 1.29k
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: