PHP Class Bolt\Asset\Widget\Queue

Author: Gawain Lynch ([email protected])
Author: Bob den Otter ([email protected])
Inheritance: implements Bolt\Asset\QueueInterface, use trait Bolt\Asset\AssetSortTrait
Afficher le fichier Open project: bolt/bolt

Protected Properties

Свойство Type Description
$cache Doctrine\Common\Cache\CacheProvider
$injector Bolt\Asset\Injector
$queue Queue with snippets of HTML to insert.
$render Twig_Environment

Méthodes publiques

Méthode Description
__construct ( Bolt\Asset\Injector $injector, CacheProvider $cache, Twig_Environment $render ) Constructor.
add ( Bolt\Asset\Widget\WidgetAssetInterface $widget ) Add a wiget to the queue.
clear ( )
countItemsInQueue ( string $location, string $zone = Zone::FRONTEND ) : boolean Get the number of queued widgets.
get ( string $key ) : Bolt\Asset\Widget\WidgetAssetInterface Get a widget from the queue.
getQueue ( ) : Bolt\Asset\Widget\WidgetAssetInterface[] Get the queued widgets.
getRendered ( string $key ) : Twig_Markup | string Get a rendered (and potentially cached) widget from the queue.
hasItemsInQueue ( string $location, string $zone = Zone::FRONTEND ) : boolean Get the number of queued widgets.
process ( Request $request, Response $response )
render ( string $location, string $zone = Zone::FRONTEND, string $wrapperTemplate = 'widgetwrapper.twig' ) : string | null Render a location's widget.

Méthodes protégées

Méthode Description
addDeferredJavaScript ( Bolt\Asset\Widget\WidgetAssetInterface $widget, Response $response ) Insert a snippet of Javascript to fetch the actual widget's contents.
getHtml ( Bolt\Asset\Widget\WidgetAssetInterface $widget ) : string Get the HTML content from the widget.

Method Details

__construct() public méthode

NOTE: Constructor type hint for TwigEnvironment omitted for BC, add in v4
public __construct ( Bolt\Asset\Injector $injector, CacheProvider $cache, Twig_Environment $render )
$injector Bolt\Asset\Injector
$cache Doctrine\Common\Cache\CacheProvider
$render Twig_Environment

add() public méthode

Add a wiget to the queue.
public add ( Bolt\Asset\Widget\WidgetAssetInterface $widget )
$widget Bolt\Asset\Widget\WidgetAssetInterface

addDeferredJavaScript() protected méthode

Insert a snippet of Javascript to fetch the actual widget's contents.
protected addDeferredJavaScript ( Bolt\Asset\Widget\WidgetAssetInterface $widget, Response $response )
$widget Bolt\Asset\Widget\WidgetAssetInterface
$response Symfony\Component\HttpFoundation\Response

clear() public méthode

public clear ( )

countItemsInQueue() public méthode

Get the number of queued widgets.
public countItemsInQueue ( string $location, string $zone = Zone::FRONTEND ) : boolean
$location string Location (e.g. 'dashboard_aside_top')
$zone string Either Zone::FRONTEND or Zone::BACKEND
Résultat boolean

get() public méthode

Get a widget from the queue.
public get ( string $key ) : Bolt\Asset\Widget\WidgetAssetInterface
$key string
Résultat Bolt\Asset\Widget\WidgetAssetInterface

getHtml() protected méthode

Get the HTML content from the widget.
protected getHtml ( Bolt\Asset\Widget\WidgetAssetInterface $widget ) : string
$widget Bolt\Asset\Widget\WidgetAssetInterface
Résultat string

getQueue() public méthode

Get the queued widgets.
public getQueue ( ) : Bolt\Asset\Widget\WidgetAssetInterface[]
Résultat Bolt\Asset\Widget\WidgetAssetInterface[]

getRendered() public méthode

Get a rendered (and potentially cached) widget from the queue.
public getRendered ( string $key ) : Twig_Markup | string
$key string
Résultat Twig_Markup | string

hasItemsInQueue() public méthode

Get the number of queued widgets.
public hasItemsInQueue ( string $location, string $zone = Zone::FRONTEND ) : boolean
$location string Location (e.g. 'dashboard_aside_top')
$zone string Either Zone::FRONTEND or Zone::BACKEND
Résultat boolean

process() public méthode

public process ( Request $request, Response $response )
$request Symfony\Component\HttpFoundation\Request
$response Symfony\Component\HttpFoundation\Response

render() public méthode

Render a location's widget.
public render ( string $location, string $zone = Zone::FRONTEND, string $wrapperTemplate = 'widgetwrapper.twig' ) : string | null
$location string Location (e.g. 'dashboard_aside_top')
$zone string Either Zone::FRONTEND or Zone::BACKEND
$wrapperTemplate string Template file for wrapper
Résultat string | null

Property Details

$cache protected_oe property

protected CacheProvider,Doctrine\Common\Cache $cache
Résultat Doctrine\Common\Cache\CacheProvider

$injector protected_oe property

protected Injector,Bolt\Asset $injector
Résultat Bolt\Asset\Injector

$queue protected_oe property

Queue with snippets of HTML to insert.
protected $queue

$render protected_oe property

protected Twig_Environment $render
Résultat Twig_Environment