lucianocn
(Luciano Cn)
1
I would like to know how can I access a Model function from Controller.
Model.php
public function checkAccess()
{
...
}
Controller.php
Model::checkAccess();
Error:
Fatal error: Call to undefined method Model::checkAccess()...
Keith
(Kburton)
2
Model::checkAccess() is attempting to call a static method. You should either mark the method as static
public static function checkAccess()
{
...
}
or call it from an instance of the class, such as
Model::model()->checkAccess();
See if changing that fixes your problem.