Zend\Mvc\Controller\AbstractController::getMethodFromAction PHP Method

getMethodFromAction() public static method

Transform an "action" token into a method name
public static getMethodFromAction ( string $action ) : string
$action string
return string
    public static function getMethodFromAction($action)
    {
        $method = str_replace(['.', '-', '_'], ' ', $action);
        $method = ucwords($method);
        $method = str_replace(' ', '', $method);
        $method = lcfirst($method);
        $method .= 'Action';
        return $method;
    }

Usage Example

コード例 #1
0
ファイル: Authorized.php プロジェクト: gontero/gontero-acl
 /**
  * @return type
  */
 public function getMethodName()
 {
     if (!$this->methodName) {
         $action = $this->getRouteMatch()->getParam('action', 'not-found');
         $this->setMethodName(AbstractController::getMethodFromAction($action));
     }
     return $this->methodName;
 }
All Usage Examples Of Zend\Mvc\Controller\AbstractController::getMethodFromAction