W3cubDocs

/Phalcon 2

Class Phalcon\Assets\Collection

implements Countable, Iterator, Traversable

Represents a collection of resources

Methods

public Phalcon\Assets\Collection add (Phalcon\Assets\Resource $resource)

Adds a resource to the collection

public Phalcon\Assets\Collection addCss (string $path, [boolean $local], [boolean $filter], [array $attributes])

Adds a CSS resource to the collection

public Phalcon\Assets\Collection addJs (string $path, [boolean $local], [boolean $filter], [array $attributes])

Adds a javascript resource to the collection

public Phalcon\Assets\Resource [] getResources ()

Returns the resources as an array

public int count ()

Returns the number of elements in the form

public rewind ()

Rewinds the internal iterator

public Phalcon\Assets\Resource current ()

Returns the current resource in the iterator

public int key ()

Returns the current position/key in the iterator

public next ()

Moves the internal iteration pointer to the next position

public boolean valid ()

Check if the current element in the iterator is valid

public Phalcon\Assets\Collection setTargetPath (string $targetPath)

Sets the target path of the file for the filtered/join output

public string getTargetPath ()

Returns the target path of the file for the filtered/join output

public Phalcon\Assets\Collection setSourcePath (string $sourcePath)

Sets a base source path for all the resources in this collection

public string getSourcePath ()

Returns the base source path for all the resources in this collection

public Phalcon\Assets\Collection setTargetUri (string $targetUri)

Sets a target uri for the generated HTML

public string getTargetUri ()

Returns the target uri for the generated HTML

public Phalcon\Assets\Collection setPrefix (string $prefix)

Sets a common prefix for all the resources

public string getPrefix ()

Returns the prefix

public Phalcon\Assets\Collection setLocal (boolean $local)

Sets if the collection uses local resources by default

public boolean getLocal ()

Returns if the collection uses local resources by default

public $this setAttributes (array $attributes)

Sets extra HTML attributes

public array getAttributes ()

Returns extra HTML attributes

public Phalcon\Assets\Collection addFilter (Phalcon\Assets\FilterInterface $filter)

Adds a filter to the collection

public Phalcon\Assets\Collection setFilters (array $filters)

Sets an array of filters in the collection

public array getFilters ()

Returns the filters set in the collection

public Phalcon\Assets\Collection join (boolean $join)

Sets if all filtered resources in the collection must be joined in a single result file

public boolean getJoin ()

Returns if all the filtered resources must be joined

public string getRealTargetPath ([string $basePath])

Returns the complete location where the joined/filtered collection must be written

public Phalcon\Assets\Collection setTargetLocal (boolean $targetLocal)

Sets the target local

public boolean getTargetLocal ()

Returns the target local

© 2011–2016 Phalcon Framework Team
Licensed under the Creative Commons Attribution License 3.0.
https://docs.phalconphp.com/en/2.0.0/api/Phalcon_Assets_Collection.html