Elgg\Http\ResponseFactory::parseContext PHP Метод

parseContext() публичный Метод

Parses response type to be used as plugin hook type
public parseContext ( ) : string
Результат string
    public function parseContext()
    {
        $segments = $this->request->getUrlSegments();
        $identifier = array_shift($segments);
        switch ($identifier) {
            case 'ajax':
                $page = array_shift($segments);
                if ($page === 'view') {
                    $view = implode('/', $segments);
                    return "view:{$view}";
                } else {
                    if ($page === 'form') {
                        $form = implode('/', $segments);
                        return "form:{$form}";
                    }
                }
                array_unshift($segments, $page);
                break;
            case 'action':
                $action = implode('/', $segments);
                return "action:{$action}";
        }
        array_unshift($segments, $identifier);
        $path = implode('/', $segments);
        return "path:{$path}";
    }