Dear All, I’m new to php and web design, I got a little question on how does Yii link the view with controller’s special action such as actionLogin. Below is the detail description of my question:
In default webapp framework, there is a view file view/site/login.php. In the siteController.php, it calls the render function
$this->render(‘login’,array(‘model’=>$model));
so the controller file link the model with the view.
however, I didn’t see any code in login.php that designate the default action as login by submit button. How does Yii link the view with specific action?
Could any one help me to answer this question? Thanks a lot.
Dear Crikey, Thanks for your help. But my question is that how does Yii make controller’s login action linked with view’s submit callback.
you see, in the previous post, the form’s submit action will call “http://localhost/queue/index.php?r=site/login” page. But I didn’t find the related code in view/site/login.php file. This file is rendered by siteController->actionLogin method, so I think must Yii did some background work to glue action and view together. I just don’t know how.
/**
* @var mixed the form action URL (see {@link CHtml::normalizeUrl} for details about this parameter).
*[color="#FF0000"] If not set, the current page URL is used.[/color]
*/
public $action='';
......