Welcome to FrostSW!

FrostMVC PHP Framework

Documentation   |   Version

View

FrostMVC\View

use FrostMVC\View;

View rendering helpers.

Methods

::get()

Renders a Twig view template and prints the output, or returns the raw file contents when $data is true. Looks for the file with and without a '.php.twig' extension. Renders the errors/uh_oh error page when the view file cannot be found.

::route()

Loads a controller class by name and calls its route() method.

get() static

View::get($page, $data = [])

Renders a Twig view template and prints the output, or returns the raw file contents when $data is true. Looks for the file with and without a '.php.twig' extension. Renders the errors/uh_oh error page when the view file cannot be found.

Parameters

$page string

The view path relative to app/views/ (without extension).

$data array|true

Variables passed to the Twig template, or true to return raw file contents.

Default: []

route() static

View::route($class, $pages = false)

Loads a controller class by name and calls its route() method.

Parameters

$class string

The controller class name (without namespace).

$pages array|false

URL segment array to pass to route().

Default: false

Generated from core/classes/View.php (FrostMVC ).