Set default controller
Add configuration in /protected/config/main.php
Copy code The code is as follows:
return array(
'name'=> ;'Auto',
'defaultController'=>'auto',
The default controller configured above is AutoController.php
Set default action
Set in AutoController.php
Copy code The code is as follows:
class AutoController extends CController
{
public $defaultAction = 'test' ;
public function actionTest()
{
...
}
...
At this time, accessing xxxx/index.php will by default go to xxxx/index.php?r=auto/test
http://www.bkjia.com/PHPjc/763013.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/763013.htmlTechArticleSet the default controller. Add the configuration in /protected/config/main.php and copy the code. The code is as follows: ?php return array( 'name'='Auto', 'defaultController'='auto', the above configures the default co...