Clickalicious\PhpMemAdmin\App::render PHP Метод

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

The application is split in this way so we are able to execute the whole stack painless with mock data for unit tests and stuff like that.
Автор: Benjamin Carl ([email protected])
public render ( string $route = self::DEFAULT_BASEURL, array $arguments = [] ) : string
$route string The route running
$arguments array Arguments from request
Результат string The rendered HTML(5) template ready for delivery
    public function render($route = self::DEFAULT_BASEURL, array $arguments = array())
    {
        // Prepare argument input ...
        $this->parseArguments($arguments);
        $action = $this->getAction();
        $this->processRequestOperations($action, $arguments);
        // Now check for action
        switch ($action) {
            case self::ACTION_DASHBOARD:
            case self::ACTION_HOST_DETAILS:
            case self::ACTION_DATA_MANAGEMENT:
            case self::ACTION_MEMORY_DETAILS:
            case self::ACTION_ABOUT:
                break;
            case self::ACTION_LOGOUT:
                header('Location: ' . $this->getLinkForAction(self::ACTION_NEUTRAL));
                exit;
            default:
                // Intentionally left blank
                break;
        }
        // send headers
        header('Content-Type: text/html; charset=utf-8');
        // Return rendered HTML(5)
        return $this->renderTemplate($this->loadTemplates($this->actionToTemplates($action)), array('content' => $this->getContent($action), 'message' => $this->getMessages()));
    }