Re: call function from .ctp file in cakephp1.2
Issac is right. In General: Use requestAction and Elements Use an existing Cake Helper Create a custom Helper On Jul 21, 4:05 am, Isaac Raja wrote: > Please mention what you are trying to achieve; we can find a better way to > do it. > > Isaac > > On Tue, Jul 21, 2009 at 2:49 AM, Marcelo Andrade wrote: > > > > > On Mon, Jul 20, 2009 at 2:02 AM, liyakat Ali wrote: > > > i need to call function from .ctp file. > > > And function is defined in App Controller. > > > is it possible. > > > As Pixelastic and Rob both said, if you have to call > > some method in your view, this method is best suited > > to be placed in a helper and not in your controller. > > > Check this out: > > >http://book.cakephp.org/view/101/Creating-Helpers > > > Best regards. > > > -- > > MARCELO DE F. ANDRADE > > Belem, PA, Amazonia, Brazil > > Linux User #221105 > > >http://mfandrade.wordpress.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: call function from .ctp file in cakephp1.2
Please mention what you are trying to achieve; we can find a better way to do it. Isaac On Tue, Jul 21, 2009 at 2:49 AM, Marcelo Andrade wrote: > > On Mon, Jul 20, 2009 at 2:02 AM, liyakat Ali wrote: > > i need to call function from .ctp file. > > And function is defined in App Controller. > > is it possible. > > As Pixelastic and Rob both said, if you have to call > some method in your view, this method is best suited > to be placed in a helper and not in your controller. > > Check this out: > > http://book.cakephp.org/view/101/Creating-Helpers > > Best regards. > > -- > MARCELO DE F. ANDRADE > Belem, PA, Amazonia, Brazil > Linux User #221105 > > http://mfandrade.wordpress.com > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: call function from .ctp file in cakephp1.2
On Mon, Jul 20, 2009 at 2:02 AM, liyakat Ali wrote: > i need to call function from .ctp file. > And function is defined in App Controller. > is it possible. As Pixelastic and Rob both said, if you have to call some method in your view, this method is best suited to be placed in a helper and not in your controller. Check this out: http://book.cakephp.org/view/101/Creating-Helpers Best regards. -- MARCELO DE F. ANDRADE Belem, PA, Amazonia, Brazil Linux User #221105 http://mfandrade.wordpress.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: call function from .ctp file in cakephp1.2
It's probably possible, but doing so would break the MVC conventions that CakePHP is built around. Perhaps re-assess how you are solving the problem and attempt to find a solution that follows MVC guidelines. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: call function from .ctp file in cakephp1.2
If you have to call a controller method from a view, you're (very) probably doing it wrong. Can't you just pass the result of your function to the view using $this->set() in your controller's action ? On Jul 20, 7:02 am, liyakat Ali wrote: > i need to call function from .ctp file. > > And function is defined in App Controller. > > is it possible. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
call function from .ctp file in cakephp1.2
i need to call function from .ctp file. And function is defined in App Controller. is it possible. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---