• support@answerspoint.com

Cakephp 2 call a model function from view

606

is it possible to call a model function directly from a view in Cakephp 2? I know I could call it from controller and set the value to the view, but if I could call it in the view it would be better...

Thanks

2Answer


0

Can using in View same in Controller:

    App::import('Model', 'Department');
    $this->Department = new Department();
    $users = $this->Department->getUserOfDepartment($id);
  • answered 3 years ago
  • G John

0

No, it goes against the whole point of the framework and core MVC principles.

Just don't do it.

  • answered 3 years ago
  • Gul Hafiz

Your Answer

    Facebook Share        
       
  • asked 3 years ago
  • viewed 606 times
  • active 3 years ago

Hot Questions