those are callbacks - special methods belonging to the controller logic thats why
On 19 Okt., 16:07, Joshua Muheim <[email protected]> wrote: > OK, so why do several CakePHP methods don't have an underscore? Like > beforeFilter()? I know, CakePHP will probably be smart enough to not > allow this to be called as an action through the browser, but > still...? :-P > > On Tue, Oct 19, 2010 at 4:00 PM, Joshua Muheim <[email protected]> wrote: > > Thanks for the hint with the components! :-) > > > On Tue, Oct 19, 2010 at 3:59 PM, euromark <[email protected]> > > wrote: > >> yep, thats right (for example from the acl shell) > >> or YOU could accidently misinterpret it as an action > > >> so either way it is still helpful to use the underscores :) > > >> but in most cases you usually can put that could in a component > >> doesnt have to be a controller _function... > > >> On 19 Okt., 15:44, psybear83 <[email protected]> wrote: > >>> As mentioned before, I have taken over an existing CakePHP > >>> application... and it's not a very good one. I'm working since a month > >>> or more on things like writing tests (there haven't been any before), > >>> cleaning and rewriting code etc. > > >>> So now I stumbled over some methods in a controller that aren't > >>> actions, but they don't have underscores "_" in front of their > >>> names... so I ask you: they *really should have*, right?? > > >>> I know the conventions, that protected and private methods and > >>> attributes should have an underscore (or even two in some conventions) > >>> for visual reasons back from the days of PHP4, but that's not what's > >>> really important here, right? It's important here because when not > >>> having an underscore, it will be "mistaken" by CakePHP for an > >>> available action, right? > > >>> So aside from that, are you following the convention mentioned above? > >>> Should I use it when coding a CakePHP application? Or is it somewhat > >>> outdated? > > >>> Thanks > >>> Josh > > >> 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
