设置默认controller
在/protected/config/main.php添加配置
<span 1</span> <?<span php </span><span 2</span> <span return</span> <span array</span><span ( </span><span 3</span> 'name'=>'Auto', <span 4</span> 'defaultController'=>'auto', <span 5</span> ...
上述配置了默认的controller为AutoController.php
设置默认action
在AutoController.php中设置
<span class</span> AutoController <span extends</span><span CController { </span><span public</span> <span $defaultAction</span> = 'test'<span ; </span><span public</span> <span function</span><span actionTest() { </span>...<span } </span>...
此时访问xxxx/index.php会默认转到xxxx/index.php?r=auto/test