holala
(Holala)
1
i definded a scope in User model,just like :
public function sID($id)
{
...
}
and in controller group,i want use this scope in with()
Groups::model()->with('User');
but i don’t know how to call the sID function in the model User.
Please help!
Thank you!
Onman
(O Rijkers)
2
Try
$result=Groups::model()->sID($id)->with('User')->findAll();
mikl
(Mike)
3
@holala:
You can’t use parameterized scopes in with(), only those defined in scopes(). See the section at the bottom of this page:
http://www.yiiframework.com/doc/guide/database.arr