PHP Класс Bolt\Asset\Widget\Queue

Автор: Gawain Lynch ([email protected])
Автор: Bob den Otter ([email protected])
Наследование: implements Bolt\Asset\QueueInterface, use trait Bolt\Asset\AssetSortTrait
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$cache Doctrine\Common\Cache\CacheProvider
$injector Bolt\Asset\Injector
$queue Queue with snippets of HTML to insert.
$render Twig_Environment

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
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.

Описание методов

__construct() публичный Метод

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() публичный Метод

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

addDeferredJavaScript() защищенный Метод

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 clear ( )

countItemsInQueue() публичный Метод

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
Результат boolean

get() публичный Метод

Get a widget from the queue.
public get ( string $key ) : Bolt\Asset\Widget\WidgetAssetInterface
$key string
Результат Bolt\Asset\Widget\WidgetAssetInterface

getHtml() защищенный Метод

Get the HTML content from the widget.
protected getHtml ( Bolt\Asset\Widget\WidgetAssetInterface $widget ) : string
$widget Bolt\Asset\Widget\WidgetAssetInterface
Результат string

getQueue() публичный Метод

Get the queued widgets.
public getQueue ( ) : Bolt\Asset\Widget\WidgetAssetInterface[]
Результат Bolt\Asset\Widget\WidgetAssetInterface[]

getRendered() публичный Метод

Get a rendered (and potentially cached) widget from the queue.
public getRendered ( string $key ) : Twig_Markup | string
$key string
Результат Twig_Markup | string

hasItemsInQueue() публичный Метод

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
Результат boolean

process() публичный Метод

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

render() публичный Метод

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
Результат string | null

Описание свойств

$cache защищенное свойство

protected CacheProvider,Doctrine\Common\Cache $cache
Результат Doctrine\Common\Cache\CacheProvider

$injector защищенное свойство

protected Injector,Bolt\Asset $injector
Результат Bolt\Asset\Injector

$queue защищенное свойство

Queue with snippets of HTML to insert.
protected $queue

$render защищенное свойство

protected Twig_Environment $render
Результат Twig_Environment