/**
* Get the current action
* REMARK: You should not use this method from your code, but it has to be
* public so we can access it later on in the core-code
*
* @return string
*/
public function getAction()
{
// no action specified?
if ($this->action === null) {
// get first parameter
$actionParameter = $this->URL->getParameter(0);
// unknown action and not provided in URL
if ($actionParameter === null) {
$this->setAction($this->config->getDefaultAction());
} else {
// action provided in the URL
// loop possible actions
$actionParameter = \SpoonFilter::toCamelCase($actionParameter);
foreach ($this->config->getPossibleActions() as $actionName) {
// get action that should be passed as parameter
$actionURL = \SpoonFilter::toCamelCase(urlencode(FL::act(\SpoonFilter::toCamelCase($actionName))));
// the action is the requested one
if ($actionURL == $actionParameter) {
// set action
$this->setAction($actionName);
// stop the loop
break;
}
}
}
}
return $this->action;
}