• How to call Model’s method from within the View in CakePHP
    Calling Model’s method is against the CakePHP conventions. Model methods should be called in controller function and then result should be set as variable to use in view.  But due to any reason if you need to call directly in view then you can use below script: Implement its and let me know if any issue, ...
    Read more...
  • How to call controller’s method from within the View in CakePHP
    Although this is the not CakePHP way to call controller’s method from within the view file, but if no other way then its possible to call controller’s method directly in view. Assuming controller name as EmployeesController.php and method name as get_employee_list something as given below: public functions get_employee_list($department_id){ // code here } You can use below script to call above ...
    Read more...
  • How to sort array in View by using Set::sort() in CakePHP
    You can sort array at the time of fetching data by using order in Model find function, but in case due to any  reason if you could not get the array in desired order then you can sort the same in view file also by using Set::sort() Suppose below standard CakepPHP $employee array you have got ...
    Read more...

Comment here