< Class Phalcon\Assets\Inline\Js


Class Phalcon\Assets\Resource >


Class Phalcon\Assets\Manager

Source on GitHub

Manages collections of CSS/Javascript assets


public __construct ([array $options])

public setOptions (array $options)

Sets the manager options

public getOptions ()

Returns the manager options

public useImplicitOutput (unknown $implicitOutput)

Sets if the HTML generated must be directly printed or returned

public addCss (unknown $path, [unknown $local], [unknown $filter], [unknown $attributes])

Adds a Css resource to the ‘css’ collection


$assets->addCss('', false);

public addInlineCss (unknown $content, [unknown $filter], [unknown $attributes])

Adds a inline Css to the ‘css’ collection

public addJs (unknown $path, [unknown $local], [unknown $filter], [unknown $attributes])

Adds a javascript resource to the ‘js’ collection


$assets->addJs('', false);

public addInlineJs (unknown $content, [unknown $filter], [unknown $attributes])

Adds a inline javascript to the ‘js’ collection

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

Adds a resource by its type


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

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

Adds a inline code by its type

public addResource (Phalcon\Assets\Resource $resource)

Adds a raw resource to the manager


 $assets->addResource(new Phalcon\Assets\Resource('css', 'css/style.css'));

public addInlineCode (Phalcon\Assets\Inline $code)

Adds a raw inline code to the manager

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

Sets a collection in the Assets Manager


 $assets->set('js', $collection);

public get (unknown $id)

Returns a collection by its id


 $scripts = $assets->get('js');

public getCss ()

Returns the CSS collection of assets

public getJs ()

Returns the CSS collection of assets

public collection (unknown $name)

Creates/Returns a collection of resources

public output (Phalcon\Assets\Collection $collection, callback $callback, string $type)

Traverses a collection calling the callback to generate its HTML

public outputInline (Phalcon\Assets\Collection $collection, string $type)

Traverses a collection and generate its HTML

public outputCss ([string $collectionName])

Prints the HTML for CSS resources

public outputInlineCss ([string $collectionName])

Prints the HTML for inline CSS

public outputJs ([string $collectionName])

Prints the HTML for JS resources

public outputInlineJs ([string $collectionName])

Prints the HTML for inline JS

public getCollections ()

Returns existing collections in the manager

Follow along: