Model + Services |
Documentation says
Quote:It is recommended to only create services within controllers. Other files, like models and libraries should have the dependencies either passed into the constructor or through a setter method. In Services.php i have 6 such methods as PHP Code: public static function permissions($getShared = true) I have to write in every model PHP Code: class SomeModel extends Model {
In your Model's constructor, no need to pass the services as arguments. You can just call
$this->permissions = Services::permissions(); Do the same with the others you need. |
Welcome Guest, Not a member yet? Register Sign In |