Hello!
I've been attempting to camlize my action names according to this instruction: https://github.com/phalcon/docs/blob/master/en/reference/dispatching.rst#camelize-action-names
However, whenever I enter a hyphen instead of a camlized name, "$dispatcher->getActionName()" is always NULL. I've removed all my custom routing to make sure there's nothing I've overridden to make it so.
Example: URL: https://localhost/user/createItem $dispatcher->getActionName() = "createItem"
URL: https://localhost/user/create-item $dispatcher->getActionName() = NULL
What am I doing wrong?
I'm runnig Apache2 on Mac OSX Mountain Lion.
Thanks.
// dimhoLt
EDIT: I solved the above issue temporarily by adding the following route:
$router->add(
"/([a-zA-Z\-]+)/([a-zA-Z\-]+)",
array(
"controller" => 1,
"action" => 2
)
);
But firstly, this seems like the wrong way to do it since /controller/action is implicit, and secondly, the correct action is still not executed (action names have lower-case first characters, so I set the action name to lcfirst(\Phalcon\Text::camelize($dispatcher->getActionName())), should be correct).
Any assistance is appreciated. Thank you.