Class ParentController
This is the parent class for all controllers in /src/controllers, and indirectly for all controllers
that extend VendorController (which, in turn, extend this).
ParentController is the class that manages assets, paths, $_GET and $_POST, views, etc.
Direct known subclasses
Controller, Core\ErrorController, Core\ExceptionController, Core\LoginController, Vendor\VendorControllerIndirect known subclasses
ErrorController, HomeController, LicenseController, LoginController, MenuController, Vendor\Landingpage\LandingController, Vendor\Menu\MenuControllerAuthor: Nico Kupfer nico@kupfer.es
Hooks:
('include_show_view', ['vars' => $this->vars]) // Called just before including the view fileCore\ParentController::show()
('include_get_view', ['vars' => $_vars]) // Called just before including a view fileCore\ParentController::get()
('extra_params_path', ['route' => $route]) // If extra parameters are required when creating a urlCore\ParentController::$path
Located at ParentController.php
public
|
|
public static
|
|
public
|
|
public
mixed
|
#
getGet( $key, $fallback = NULL )
Filters an input (GET) variable and returns it. If key doesn't exist or the value equals NULL, returns $fallback |
public
mixed
|
#
getPost( $key, $fallback = NULL )
Filters an input (POST) variable and returns it. If key doesn't exist or the value equals NULL, returns $fallback |
public
|
#
show( string $view, string $template = 'default' )
Shows a view inside a specified template Remember that both $view and $template can be absolute or relative paths |
public
string
|
|
public
string
|
|
public
mixed
|
#
path( string $path = '', array $params = array(), boolean $return = FALSE )
Returns the web path for a given Route name |
public
string
|
#
url( string $path, array $params = array() )
Alias for ::path with $return = TRUE. Use it for controllers |
public
|
|
public
|
|
public
|
#
addJSVar( string $var, mixed $value, boolean $encoded = TRUE )
Adds a JS variable to the $this->show() renderer. |
public
|
#
addStyle( string $path, boolean|true $local = TRUE, boolean|true $minimize = TRUE )
Adds a script snippet to the $this->show() renderer. |
public
|
#
addScript( string $path, boolean|true $local = TRUE, boolean|true $minimize = TRUE )
Adds a style snippet to the $this->show() renderer. |
public
|
|
public
string
|
#
minimizeURL( array $files = [], string $type = 'js' )
Get the minified URL for the assets. This does NOT minimize files, just provide the minified url. |
public
|
#
addHeader( array $vars = [], string|boolean $headerLocation = FALSE )
Adds the $_header variable to the view |
public
|
#
addFooter( array $vars = [], string|boolean $footerLocation = FALSE )
Adds the $_footer variable to the view |
public
|
|
public
|
|
public
string
|
|
public
string
|
|
public
|
#
compressWithMinify( )
Compresses $this->vars['script'] or $this->vars['style'] into a unique minified asset |
public
|
#
header( integer $code = 200 )
Outputs the correspondent header for the given HTTP code, on the form header('HTTP/1.0 404 Not Found'); See description of the status codes in the provided url |
protected
string
|
$path
The path where the framework is located: <framework_url>/<path>/app.php. |
|
protected
|
$config
The instance of the Config class. |
|
protected
array
|
$vars
The required variables to show a view. |
|
protected
boolean
|
$ajax
If the request is an AJAX call. Set automatically by reading $_SERVER['HTTP_X_REQUESTED_WITH'] |
|
protected
|
$model
The instance of ParentModel. |
|
protected
string
|
$viewPath
Default path for files. For example, {view} = "home/index". |
|
protected
string
|
$templatePath
Default path for templates. For example, {template} = "default" or "email". |
|
protected
|
$hooks
The instance of the Hooks class. |