Marcin Domanski aka kabturek wrote:
> hey
> 
> On Jun 20, 4:24 pm, Ian Zepp <[EMAIL PROTECTED]> wrote:
>> Unlike Zend (with uses an Action suffix to designate controller
>> actions), Cake doesn't have any such thing and instead uses a blacklist
>> of 'private' controller actions (defined in the dispatcher).
> We don't ? We've got something that is called convention here ;)
> try calling a "__myAction" from the url.
> 

Perhaps I could have written more clearly. In the Dispatcher the test is 
called a $privateAction, and is checked on the presence of a '_' in the 
action.

See line 169 in libs/dispatcher.php (cake v1.2)

My blacklist comment comes from an older version of Cake, apparently. 
That particular portion is in 1.1 but doesn't seem to be in 1.2:

See line 171 in libs/dispatcher.php (cake v1.1)

>> As such, be aware that new methods defined in the controller could
>> 'potentially' be called as an action, even if that is not the expected
>> behavior.
> as long as you _don't_ follow the rules ;)

True, but that still doesn't change my statement. Only methods prefixed 
with a '_' are denied access. A function without a '_' is still a valid 
action to be called, even if it is not intended to be an action, and 
EVEN if it scoped as a protected or private member, since PHP5 still 
doesn't prevent you from calling private methods as public. It just 
warns you if E_STRICT is on.

I do agree, on principle, that non-actions should be written as 
protected or private methods. I'm was just pointing out the convention 
differences (from Zend) and potential pitfalls of the cake dispatcher model.


> > 

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to