Overview

Namespaces

  • Core
    • Auth
    • Exceptions
    • Helpers
    • Providers
  • Kernel
    • Dispatch
    • Providers
  • None
  • Vendor
    • ExampleVendor

Classes

  • VendorController
  • Overview
  • Namespace
  • Class
  • Download

Class VendorController

Class VendorController is the parent class for all plugins (located in the plugin folder).
Please notice that some functions, when called from plugins, have different names (view, get, asset). See @see for more details.

Core\ParentController
Extended by Vendor\VendorController

Direct known subclasses

Vendor\ExampleVendor\ExampleVendorController
Namespace: Vendor
Package: Vendor
See: VendorController@vendor_show
See: VendorController@vendor_get
See: VendorController@vendor_asset
Note: Respect the directives for creating new plugins. See the example ones for more info.
Located at app/controllers/VendorController.php
Methods summary
public static Vendor\VendorController
# singleton( )

Returns the class Singleton

Returns the class Singleton

Returns

Vendor\VendorController

Overrides

Core\ParentController::singleton()
public
# __construct( )

Overrides

Core\ParentController::__construct()
public
# vendor_show( string $view, string|boolean $template = FALSE )

This is an implementation of ParentController@show() to allow for plugins.

This is an implementation of ParentController@show() to allow for plugins.

Shows a view embedded inside a specified template and die() Remember that both $view and $template can be absolute or relative paths

Parameters

$view
The path to the file, being '/' the 'html' directory
$template
The name of the template. If no template is specified, we use the default one

Throws

Exception
specifying the type of missing view.
public string
# vendor_get( string $view, array|[] $vars = [], string|boolean $template = FALSE )

This is an implementation of ParentController@get() to allow for plugins.

This is an implementation of ParentController@get() to allow for plugins.

Returns a view, optionally embedded inside a specified template. Remember that both $view and $template can be absolute or relative paths

Parameters

$view
The path to the file, being '/' the 'html' directory
$vars
The vars that you want to show in the $view
$template
The name of the template. If no template is specified, we use the default one

Returns

string
The rendered view / view+template

Throws

Exception
specifying the type of missing view.
public
# vendorSaveCache( )

Saves the vendor directives (Folders, Controllers, Models, Routing and Permissions) to a cache file.
Outputs a JSON encoded array.

Saves the vendor directives (Folders, Controllers, Models, Routing and Permissions) to a cache file.
Outputs a JSON encoded array.

public Vendor\VendorController
# addStyle( string $path, boolean|true $local = TRUE, boolean $dummy = TRUE )

Adds a style snippet to the $this->vendor_show() renderer.

Adds a style snippet to the $this->vendor_show() renderer.

Parameters

$path
The path under which the asset is located
$local
whether it's a relative (local) or absolute URL
$dummy
To prevent StrictStandards warning

Returns

Vendor\VendorController

Overrides

Core\ParentController::addStyle()
public Vendor\VendorController
# addScript( string $path, boolean|true $local = TRUE, boolean $dummy = TRUE )

Adds a script snippet to the $this->vendor_show() renderer.

Adds a script snippet to the $this->vendor_show() renderer.

Parameters

$path
The path under which the asset is located
$local
whether it's a relative (local) or absolute URL
$dummy
To prevent StrictStandards warning

Returns

Vendor\VendorController

Overrides

Core\ParentController::addScript()
public string|Vendor\VendorController
# vendor_asset( string $path, boolean|false $return = FALSE )

Echoes or returns the absolute path to the asset

Echoes or returns the absolute path to the asset

Parameters

$path
The path under which the view is located
$return
Whether to return or echo

Returns

string|Vendor\VendorController
The absolute path (or $this if 'echo')
public Vendor\VendorController
# addHeader( array $vars = [], string|boolean $headerLocation = FALSE )

Adds the $_header variable to the view

Adds the $_header variable to the view

Parameters

$vars
$vars|[] The vars to pass to the header
$headerLocation
an (optional) alternative route for the header

Returns

Vendor\VendorController

Overrides

Core\ParentController::addHeader()
public Vendor\VendorController
# addFooter( array $vars = [], string|boolean $footerLocation = FALSE )

Adds the $_footer variable to the view

Adds the $_footer variable to the view

Parameters

$vars
$vars|[] The vars to pass to the footer
$footerLocation
an (optional) alternative route for the footer

Returns

Vendor\VendorController

Overrides

Core\ParentController::addFooter()
Methods inherited from Core\ParentController
add(), addJSVar(), asset(), cache(), compressWithMinify(), get(), getGet(), getModel(), getPost(), header(), json(), minimize(), minimizeURL(), path(), redirect(), setFavicon(), setTitle(), show(), url()
Properties summary
public string $pluginFolder

The path where each plugin is stored. Set individually in each plugin (children).

The path where each plugin is stored. Set individually in each plugin (children).

#
protected array $vars

Array to store information about the view: scripts, styles, views, title...

Array to store information about the view: scripts, styles, views, title...

#
Properties inherited from Core\ParentController
$ajax, $config, $hooks, $model, $path, $templatePath, $viewPath
Ribosome API documentation generated by ApiGen