Hi :) > Currently I'm using the index action of a Jobs controller to list all > jobs and send it to the index view. The view file then does a quick > foreach() and prints out some data. > I need to perform a fairly complex > operation on one column for each row, which involves data from another > controller.
You can call controllers using requestAction (see http://manual.cakephp.org/chapter/controllers ) from wherever you are. However, people will generally discourage this practice since views are about how your data is displayed to the user (see the MVC pattern here http://manual.cakephp.org/chapter/basic_concepts ) and shouldn't need to know how your application works. As such people generally try to minize the logic in their views. Of course some things are done in the views - converting the format of a date, for instance. In CakePHP this is typically done using helpers (see http://manual.cakephp.org/chapter/helpers ). I do not know what you are trying to achieve -- though if you need to call another controller, I assume this operation is outside of the scope of a view, and I suggest you pre-process your array in the controller before sending it to the view. If you think your operation is within the scope of the view, then create a helper to factor the operation away, and use 'requestAction' to call your other controller. Anselm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
