Its really easy to create a login form by using cake php, for creating a form a user have to mention its type,action or url for pointing the form to the login() action to the controller, user would supply array like this. And for further fields they can use several inputs to it. The controller includes an end() method that will complete the form.
<?php
echo $this->Form->create('User', array('controller' => 'Users','url'=>'login',));
echo $this->Form->input('username', array('placeholder'=>'Please enter your name','required'));
echo $this->Form->input('email', array('placeholder'=>'Enter email', 'required'));
echo $this->Form->input('password', array('placeholder'=>'Enter your password','required'));
echo $this->Form->input('confirm',array('placeholder'=>'confirm Password', 'required'));
echo $this->Form->radio('gender', array('male'=>'Male','female'=>'Female'));
echo $this->Form->label('User.education');
echo $this->Form->checkbox('DONE',array('0'));
echo $this->Form->label('User.10th');
echo $this->Form->checkbox('DONE',array('1'));
echo $this->Form->label('User.12th');
echo $this->Form->checkbox('DONE',array('2'));
echo $this->Form->label('User.Btech');
echo $this->Form->input('birth_dt', array(
'label' => 'Date of birth',
'dateFormat' => 'DMY',
'minYear' => date('Y') - 70,
'maxYear' => date('Y') - 18,
));//day, month, year, hour, minute
echo $this->Form->input('quote');
echo $this->Form->end('login');
?>
0 Comment(s)