Assets

Assets Management

Phalcon\Assets is a component that allows you to manage static assets such as CSS stylesheets or JavaScript libraries in a web application.

Phalcon\Assets\Manager is the component you can use to register your assets and use them throughout your application. If you are using the Phalcon\Di\FactoryDefault container, the Assets Manager is already registered for you. You can access it using the assets key from your Di container.

Configurations

# define your own service provider
PROVIDER_ASSETS=\Zemit\Provider\Assets\ServiceProvider

Usage

// if the class is aware of injections
$assets = $this->assets;

// if the container is present
$assets = $this->di->get('assets');

// from outside
$assets = Di::getDefault()->get('assets');

Sources

Last updated