Table Of Contents

Previous topic

< Class Phalcon\Assets\Manager

Next topic

Class Phalcon\Assets\Resource\Css >

Class Phalcon\Assets\Resource

Represents an asset resource

<?php

 $resource = new Phalcon\Assets\Resource('js', 'javascripts/jquery.js');

Methods

public __construct (string $type, string $path, [boolean $local], [boolean $filter], [array $attributes])

Phalcon\Assets\Resource constructor

public Phalcon\Assets\Resource setType (string $type)

Sets the resource’s type

public string getType ()

Returns the type of resource

public Phalcon\Assets\Resource setPath (string $path)

Sets the resource’s path

public string getPath ()

Returns the URI/URL path to the resource

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

Sets if the resource is local or external

public boolean getLocal ()

Returns whether the resource is local or external

public Phalcon\Assets\Resource setFilter (boolean $filter)

Sets if the resource must be filtered or not

public boolean getFilter ()

Returns whether the resource must be filtered or not

public Phalcon\Assets\Resource setAttributes (array $attributes)

Sets extra HTML attributes

public array getAttributes ()

Returns extra HTML attributes set in the resource

public Phalcon\Assets\Resource 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\Resource setSourcePath (string $sourcePath)

Sets the resource’s source path

public string getSourcePath ()

Returns the resource’s target path

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

Sets the resource’s target path

public string getTargetPath ()

Returns the resource’s target path

public string getContent ([string $basePath])

Returns the content of the resource as an string Optionally a base path where the resource is located can be set

public string getRealTargetUri ()

Returns the real target uri for the generated HTML

public string getRealSourcePath ([string $basePath])

Returns the complete location where the resource is located

public string getRealTargetPath ([string $basePath])

Returns the complete location where the resource must be written