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

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 261
    Comment on it

    We can create form by using FormHelper class in Cake PHP.

    For Example:

    Create file register.ctp in (/app/view/users) directory.

    <?php 
    echo $this->Form->create('User', array('controller'=>'users', 'action'=>'login))
    echo $this->Form->input('username',array(type=>text));
    echo $this->Form->input('password', array(type=>password));
    echo $this->Form->submit(Login, array(type=>submit));
    echo  $this->Form->end();
    ?>
    

    This above code will generate Html tags, You can check below code by hit Ctrl+u:

    <form action="/users/login" method="post">
    <input type="text" name="username" />
    <input type="password" name="password" />
    <input type="submit" name="login" />
    </form>
    

 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: