src/Control/Controller.php
protected function definingClassForAction($action)
    {
        $definingClass = parent::definingClassForAction($action);
        if ($definingClass) {
            return $definingClass;
        }

        $class = static::class;
        while ($class != 'SilverStripe\\Control\\RequestHandler') {
            $templateName = strtok($class, '_') . '_' . $action;
            if (SSViewer::hasTemplate($templateName)) {
                return $class;
            }

            $class = get_parent_class($class);
        }

        return null;
    }
protected function definingClassForAction($action)
    {
        $definingClass = parent::definingClassForAction($action);
        if ($definingClass) {
            return $definingClass;
        }

        $class = static::class;
        while ($class != 'SilverStripe\\Control\\RequestHandler') {
            $templateName = strtok($class, '_') . '_' . $action;
            if (SSViewer::hasTemplate($templateName)) {
                return $class;
            }

            $class = get_parent_class($class);
        }

        return null;
    }
protected function definingClassForAction ( $ action ) { $ definingClass = parent :: definingClassForAction ( $ action ) ; if ( $ definingClass ) { return $ definingClass ; } $ class = static :: class ; while ( $ class != 'SilverStripe\\Control\\RequestHandler' ) { $ templateName = strtok ( $ class , '_' ) . '_' . $ action ; if ( SSViewer :: hasTemplate ( $ templateName ) ) { return $ class ; } $ class = get_parent_class ( $ class ) ; } return null ; }
Return the class that defines the given action, so that we know where to check allowed_actions.
Overrides RequestHandler to also look at defined templates.

@param string $action

@return string
Return the class that defines the given action so that we know where to check allowed_actions . Overrides RequestHandler to also look at defined templates .