我是 Yii 的新手。我有一个这样的控制器:
<?php
class EventsController extends Controller
{
public function actionIndex()
{
$this->render('index');
}
}
如何使以下 url 呈现正确的视图。例如。
localhost/events/intaglio -> $this->render('intaglio');
localhost/events/burrito-> $this->render('burrito');
localhost/events/jerrito -> $this->render('jerrito');
更糟糕的情况是,我必须对每个人采取单独的行动
public function actionIntagio {...}
public function actionBurrito {...}
public function actionJerrito {...}
有没有更聪明的方法来做到这一点?