On Sat, Aug 15, 2009 at 4:28 PM, Eden Cardim <[email protected]> wrote:
> > > Is there a specific reason that Private actions may not have additional > > attributes? > > You can achieve the same effect by using the :Action tag instead, as > mst suggested in reply to the same thread: > http://www.mail-archive.com/[email protected]/msg01413.html Yes, I read that back then. That wasn't my question, though. My question was *why* Private actions cannot have additional attributes? Why is there code to explicitly prevent additional attributes on Private methods? Especially since there's a work-around by simply using :Action (or just any attribute) to make a method into an action. Perhaps only Marcus might be able to answer that if he added that code. Further, if *any* attribute can make a method into an action, is there chance at some point that only a pre-defined set of attribute values would be valid? Not sure there is any reason to do this, but for example might want to have sub attributes on methods that are *not* actions, too. BTW -- :Action is mentioned in the docs at: http://search.cpan.org/~hkclark/Catalyst-Manual-5.8000/lib/Catalyst/Manual/Intro.pod#Controllers But, the text says: Note that you can also supply attributes via the Controller's config so long > as you have at least one attribute on a subref to be exported (:Action is > commonly used for this) - for example the following is equivalent to the > same controller above: > That doesn't sound correct. I think just listing the method in config "actions" is enough. That is, __PACKAGE__->config( actions => { foo => { Path => 'bar' } } ); > sub foo {} > will work because configured "actions" method names are just pushed onto the list of method names returned by $meta->get_nearest_methods_with_attributes. No ":Action" (or any attribute) required. -- Bill Moseley [email protected]
_______________________________________________ List: [email protected] Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[email protected]/ Dev site: http://dev.catalyst.perl.org/
