PHP Class Bolt\Twig\Handler\WidgetHandler

Show file Open project: bolt/bolt Class Usage Examples

Public Methods

Method Description
__construct ( Silex\Application $app )
countWidgets ( string $location = null, string $zone = Zone::FRONTEND ) : integer Return the number of widgets in the queue for a given type / location.
getWidgets ( ) : array Gets a list of the registered widgets.
hasWidgets ( string $location = null, string $zone = Zone::FRONTEND ) : boolean Check if a type / location has widgets in the queue.
widgets ( string $location = null, string $zone = Zone::FRONTEND, string $wrapper = 'widgetwrapper.twig' ) : string | Twig_Markup Renders a particular widget type on the given location.

Method Details

__construct() public method

public __construct ( Silex\Application $app )
$app Silex\Application

countWidgets() public method

Return the number of widgets in the queue for a given type / location.
public countWidgets ( string $location = null, string $zone = Zone::FRONTEND ) : integer
$location string Location (e.g. 'dashboard_aside_top')
$zone string Either Zone::FRONTEND or Zone::BACKEND
return integer

getWidgets() public method

Gets a list of the registered widgets.
public getWidgets ( ) : array
return array

hasWidgets() public method

Check if a type / location has widgets in the queue.
public hasWidgets ( string $location = null, string $zone = Zone::FRONTEND ) : boolean
$location string Location (e.g. 'dashboard_aside_top')
$zone string Either Zone::FRONTEND or Zone::BACKEND
return boolean

widgets() public method

Renders a particular widget type on the given location.
public widgets ( string $location = null, string $zone = Zone::FRONTEND, string $wrapper = 'widgetwrapper.twig' ) : string | Twig_Markup
$location string Location (e.g. 'dashboard_aside_top')
$zone string Either Zone::FRONTEND or Zone::BACKEND
$wrapper string
return string | Twig_Markup