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)