I saw the following code in the tutorials and want to ask a few questions about it:
public function actionLogin()
{
$model = new LoginForm;
$form = new CForm('application.views.site.loginForm', $model);
if($form->submitted('login') && $form->validate())
$this->redirect(array('site/index'));
else
$this->render('login', array('form'=>$form));
}
1, What does the string ‘login’ refer to in the following: $form->submitted(‘login’)
2, Why is that line of code required? Why not just $form->submitted() ?
3, What does the second parameter hold in the render function? Is it needed?
Many thanks.