i started to use the yii framework last week and i like the query builder. But if i create a action in the siteController i cant reach it over the URL index.php?r=site/test
i created the method in siteController.php like this:
public function actionTest()
{
print ('Test-Page');
}
If i put it in another controller and change the URL a little bit like "index.php?r=mycontroller/test" it works fine. What is my error in reasoning?
Every tutorial i found said that its enough to put this function in the controller, but it wont work. I see only a blank page.
I think you may be defined this action on defaultAccessRules site controller
like
public function defaultAccessRules()
{
return array(
array('allow', // allow authenticated user to perform 'create' and 'update' actions
'actions'=>array('create','test'),
'users'=>array('admin'),
),
);
}