Class Phalcon\Assets\Manager

Manages collections of CSS/Javascript assets

Methods

public __construct ([unknown $options])

public Phalcon\Assets\Manager setOptions (unknown $options)

Sets the manager options

public array getOptions ()

Returns the manager options

public Phalcon\Assets\Manager useImplicitOutput (unknown $implicitOutput)

Sets if the HTML generated must be directly printed or returned

public Phalcon\Assets\Manager addCss (unknown $path, [unknown $local], [unknown $filter], [unknown $attributes])

Adds a Css resource to the ‘css’ collection

  1. <?php
  2. $assets->addCss('css/bootstrap.css');
  3. $assets->addCss('http://bootstrap.my-cdn.com/style.css', false);

public Phalcon\Assets\Manager addInlineCss (unknown $content, [unknown $filter], [unknown $attributes])

Adds a inline Css to the ‘css’ collection

public Phalcon\Assets\Manager addJs (unknown $path, [unknown $local], [unknown $filter], [unknown $attributes])

Adds a javascript resource to the ‘js’ collection

  1. <?php
  2. $assets->addJs('scripts/jquery.js');
  3. $assets->addJs('http://jquery.my-cdn.com/jquery.js', false);

public Phalcon\Assets\Manager addInlineJs (unknown $content, [unknown $filter], [unknown $attributes])

Adds a inline javascript to the ‘js’ collection

public Phalcon\Assets\Manager addResourceByType (unknown $type, unknown $resource)

Adds a resource by its type

  1. <?php
  2. $assets->addResourceByType('css', new \Phalcon\Assets\Resource\Css('css/style.css'));

public Phalcon\Assets\Manager addInlineCodeByType (unknown $type, unknown $code)

Adds a inline code by its type

public Phalcon\Assets\Manager addResource (Phalcon\Assets\Resource $resource)

Adds a raw resource to the manager

  1. <?php
  2. $assets->addResource(new Phalcon\Assets\Resource('css', 'css/style.css'));

public Phalcon\Assets\Manager addInlineCode (unknown $code)

Adds a raw inline code to the manager

public Phalcon\Assets\Manager set (unknown $id, unknown $collection)

Sets a collection in the Assets Manager

  1. <?php
  2. $assets->set('js', $collection);

public Phalcon\Assets\Collection get (unknown $id)

Returns a collection by its id

  1. <?php
  2. $scripts = $assets->get('js');

public Phalcon\Assets\Collection getCss ()

Returns the CSS collection of assets

public Phalcon\Assets\Collection getJs ()

Returns the CSS collection of assets

public Phalcon\Assets\Collection collection (unknown $name)

Creates/Returns a collection of resources

public output (unknown $collection, unknown $callback, unknown $type)

Traverses a collection calling the callback to generate its HTML

public outputInline (unknown $collection, unknown $type)

Traverses a collection and generate its HTML

public outputCss ([unknown $collectionName])

Prints the HTML for CSS resources

public outputInlineCss ([unknown $collectionName])

Prints the HTML for inline CSS

public outputJs ([unknown $collectionName])

Prints the HTML for JS resources

public outputInlineJs ([unknown $collectionName])

Prints the HTML for inline JS