Frontend\Core\Engine\Base\Config::getDefaultAction PHP Method

getDefaultAction() public method

Get the default action
public getDefaultAction ( ) : string
return string
    public function getDefaultAction()
    {
        return $this->defaultAction;
    }

Usage Example

Beispiel #1
0
 /**
  * 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;
 }
All Usage Examples Of Frontend\Core\Engine\Base\Config::getDefaultAction