and no its not that much of a taboo as long as there arent any corresponding components/libs etc
the cleaner approach would be to write lib classes that get inherited from both a component for controllers and the helper for views but as long as it is not so you have to break with the design a little bit in order to avoid code redundance just import the helper as mentioned in the link for those time functions it is usually not neccessary to do that - a simple date(...) call usually does the trick but for flash messages with some formatting in it or other similar matters i had to use some helpers, too and it does only work for helpers that are independent (which dont call $this->AnyOtherHelper inside each other) On 21 Apr., 10:20, euromark <[email protected]> wrote: > this question has been answered like a million times > please try to search for it first! > "helper controller" in the above search field gets > > http://groups.google.com/group/cake-php/browse_thread/thread/64c8ae45... > + many others > > On 21 Apr., 07:10, calvin <[email protected]> wrote: > > > > > So I just encountered a situation where I'd like to use a helper in my > > controller even though this seems to break with Cake's MVC design. > > Googling the topic turned up a thread in this group in which > > loadHelper() is proposed as a means of doing just that, but it still > > seems to be discouraged. > > > What I'm wondering is, if this is discouraged, then why does the Time > > Helper have day/daysAsSql(). I cannot fathom a common scenario where > > you would need to display a date as: > > > ($field_name >= '2008-01-21 00:00:00') AND ($field_name <= '2008-01-21 > > 23:59:59') > > > in a view to justify the inclusion of those two functions in a helper > > rather than a component. > > > Is using a helper in a view really so taboo? > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others > > with their CakePHP related questions. > > > 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 > > athttp://groups.google.com/group/cake-php?hl=en > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with > their CakePHP related questions. > > 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 > athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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
