when you declare a function on app_controller, that means you instantiate that function in every instants of controller.
if every we need something we put the function on app_controller, i thin'k that increase the memory overhead, plus we don't correlate the function within related class. but it's odd to calling other function on other controller, many cases is calling a function on component/vendor. on MVC paradigm, as far i know the controller is just 'passing message' (become a driver) between view <-> data so for other functionalities we can create other classes (component, vendor e.g : pdf, filehandler, etc). On Thu, Sep 10, 2009 at 11:42 PM, Miles J <[email protected]> wrote: > > Well whats the problem with putting it in the AppController? Its your > application, so it should be no problem in being global and having > someone "access" it. > > If its an action that outputs the same view and contents, then perhaps > you should rethink how it works. > > On Sep 10, 1:09 am, Tokasa <[email protected]> wrote: > > Hi Miles, > > What is wrong on Mukhamad's idea? > > > > But what would you suggest, if you'd like to call some other > > controller's method but you dont want to put it globaly in > > app_controller?? > > > > Thanks > > Tomas > > > > On Sep 9, 6:18 pm, Miles J <[email protected]> wrote: > > > > > Do not listen to Mukhamad Ikhsan, that way is extremely wrong. > > > > > Simply place the method you want to use in the AppController, or > > > within a component. > > > > > On Sep 9, 6:38 am, Mukhamad Ikhsan <[email protected]> wrote: > > > > > > initialize to local variable, $variable = App::import('Controller', > > > > array('example')); > > > > > > $variable->method > > > > > > On Wed, Sep 9, 2009 at 8:36 PM, Mukhamad Ikhsan < > [email protected]>wrote: > > > > > > > App::import('Controller', array(...)); > > > > > > > > http://book.cakephp.org/view/531/Importing-Controllers-Models-Compone... > > > > > > > On Wed, Sep 9, 2009 at 3:50 PM, [email protected] < > [email protected]>wrote: > > > > > > >> Hi, how can I call method from another controller? > > > > > > >> I have read somthing about requestAction(...) but in help they say > ... > > > > >> "It is rarely appropriate to use in a controller or model." > > > > > > >> Is there other better way?? > > > > > > >> Thanks > > > > >> Tomas > > > > > > -- > > > > Mukhamad Ikhsan > > > > +6281572181283 > > > > Y!id:ikhsan.onlyhttp://www.diodachi.com > > > -- Mukhamad Ikhsan +6281572181283 Y!id:ikhsan.only http://www.diodachi.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" 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 -~----------~----~----~----~------~----~------~--~---
