FrostMVC\View
use FrostMVC\View;
View rendering helpers.
| ::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. |
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.
| $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:[] |
View::route($class, $pages = false)
Loads a controller class by name and calls its route() method.
| $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 ).