Hello everybody! Sorry for the mistakes I’ve made, I from Russia.
I’m new in Yii and learn this one from scratch by reading books and official documentation.
So…recently I tried to use "named scopes", please see that simple code which throw the error:
public function scopes() {
return array(
'testScope' => array(
'order' => 'date_entered DESC',
'limit' => 5,
)
);
}
public function actionTest() {
$model = Page::model()->testScope()->findAll();
$this->render('test', array('model'=>$model));
}
When I jump to test action, I get the following message:
CException
Page and its behaviors do not have a method or closure named "testScope".
When I rule out testScope() method from the chain(Page::model()->findAll()), everything becomes ok.
By the way, defaultScope() method doesn’t make any affect.
Thanks…