use*_*123 3 cakephp cakephp-2.1
是否可以直接从Cakephp 2中的视图调用模型函数?我知道我可以从控制器调用它并将值设置为视图,但如果我可以在视图中调用它会更好...
谢谢
小智 6
可以在Controller中使用View in same:
App::import('Model', 'Department');
$this->Department = new Department();
$users = $this->Department->getUserOfDepartment($id);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11478 次 |
| 最近记录: |