[Solar-talk] Method-Based Actions

Matthew Weier O'Phinney mweierophinney at gmail.com
Fri Jun 23 09:13:18 PDT 2006


On 6/23/06, Paul M Jones <pmjones at solarphp.com> wrote:
> On Jun 23, 2006, at 10:53 AM, Travis Swicegood wrote:
> > Paul M Jones wrote:
> > > # Instead of having "Actions/example.action.php", you now have an
> > > "exampleAction()" method in the page controller.
> > >
> >
> > I would make that actionExample().  From a documentation standpoint,
> > that puts all of the actions together in generating docs and most
> > likely
> > at the top of the list of methods.
>
> Good point; also eliminates some of the action name munging to find
> the method name.  Thoughts from others?

I personally prefer using methodAction(). My reasoning is that when
I scan through my docs, I'm typically thinking, "I need to find out what
my edit mode is doing", and look for 'e' in the method list.

As another reference point: if you have users who are coming from Zend
Framework or Rails, they're going to be looking for the method *ending*
in Action -- consistency with the industry may make transition between
frameworks/projects easier.

-- 
Matthew Weier O'Phinney
mweierophinney at gmail.com
http://weierophinney.net/matthew/


More information about the solar-talk mailing list