How to configure the default controller and action in the yii framework
This article describes how to configure the default controller and action in the yii framework, and shares an example of setting the default controller and action. If you are a friend of yii, you can refer to the example.
In the yii framework, set the default controller to add configuration in/protected/config/main. php. The specific code is as follows:
<?phpreturn array('name'=>'Auto','defaultController'=>'auto',......
The default controller is AutoController. php.
In the yii framework, set the default action in the AutoController. php file just defined. The specific code is as follows:
<?phpclass AutoController extends CController{ public $defaultAction='test'; public function actionTest(){ ... } ...
When xxxx/index. php is accessed, it is forwarded to xxxx/index. php by default? R = auto/test, indicating that the setting is successful.
Articles you may be interested in
- Common Values of Cache-control include private, no-cache, max-age, and must-revalidate.
- Detailed analysis on the directory structure of the yii framework
- URL encoding functions such as urlencode (), urldecode (), rawurlencode (), and rawurldecode ()
- Yii framework cache knowledge Summary
- Windows cannot start the hardware device because its configuration information (in the Registry) is incomplete or damaged. (Code 19) Solution
- Php prompts Call to undefined function curl_init () Error Solution
- Jquery operation cookie, jquery reading cookie, jquery setting cookie, jquery deleting cookie
- How to remove the index. php string from the website url developed by codeIgniter