PHP Class Bolt\Asset\Snippet\Queue

Author: Gawain Lynch ([email protected])
Author: Bob den Otter ([email protected])
Inheritance: implements Bolt\Asset\QueueInterface
Exibir arquivo Open project: bolt/bolt Class Usage Examples

Protected Properties

Property Type Description
$addJquery Whether to add jQuery to the HTML
$cache Doctrine\Common\Cache\CacheProvider
$config Bolt\Config
$injector Bolt\Asset\Injector
$queue Queue with snippets of HTML to insert.
$resources Bolt\Configuration\ResourceManager

Public Methods

Method Description
__construct ( Bolt\Asset\Injector $injector, CacheProvider $cache, Config $config, ResourceManager $resources ) Constructor.
add ( Bolt\Asset\Snippet\SnippetAssetInterface $snippet ) Insert a snippet. And by 'insert' we actually mean 'add it to the queue, to be processed later'.
clear ( )
getQueue ( ) : Bolt\Asset\Snippet\Snippet[] Get the queued snippets.
process ( Request $request, Response $response )

Protected Methods

Method Description
addJquery ( Request $request, Response $response ) Insert jQuery, if it's not inserted already.

Private Methods

Method Description
pregCallback ( string $c ) : string Callback method to identify comments and store them in the matchedComments array.

Method Details

__construct() public method

Constructor.
public __construct ( Bolt\Asset\Injector $injector, CacheProvider $cache, Config $config, ResourceManager $resources )
$injector Bolt\Asset\Injector
$cache Doctrine\Common\Cache\CacheProvider
$config Bolt\Config
$resources Bolt\Configuration\ResourceManager

add() public method

Insert a snippet. And by 'insert' we actually mean 'add it to the queue, to be processed later'.
public add ( Bolt\Asset\Snippet\SnippetAssetInterface $snippet )
$snippet Bolt\Asset\Snippet\SnippetAssetInterface

addJquery() protected method

Some of the patterns that 'match' are: - jquery.js - jquery.min.js - jquery-latest.js - jquery-latest.min.js - jquery-1.8.2.min.js - jquery-1.5.js
protected addJquery ( Request $request, Response $response )
$request Symfony\Component\HttpFoundation\Request
$response Symfony\Component\HttpFoundation\Response

clear() public method

public clear ( )

getQueue() public method

Get the queued snippets.
public getQueue ( ) : Bolt\Asset\Snippet\Snippet[]
return Bolt\Asset\Snippet\Snippet[]

process() public method

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

Property Details

$addJquery protected_oe property

Whether to add jQuery to the HTML
protected $addJquery

$cache protected_oe property

protected CacheProvider,Doctrine\Common\Cache $cache
return Doctrine\Common\Cache\CacheProvider

$config protected_oe property

protected Config,Bolt $config
return Bolt\Config

$injector protected_oe property

protected Injector,Bolt\Asset $injector
return Bolt\Asset\Injector

$queue protected_oe property

Queue with snippets of HTML to insert.
protected $queue

$resources protected_oe property

protected ResourceManager,Bolt\Configuration $resources
return Bolt\Configuration\ResourceManager