BearFramework\App\Assets

Provides utility functions for assets.
BearFramework\App\Assets {

    
/* Properties */
    
public readonly string $pathPrefix

    
/* Methods */
    
public __construct BearFramework\App $app )
    public 
self addDir string $pathname )
    public 
self addEventListener string $name , callable $listener )
    public 
self dispatchEvent string $name [, mixed $details ] )
    public 
string|null getContent string $filename [, array $options = [] ] )
    public array 
getDetails string $filename , array $list )
    public 
BearFramework\App\Response|null getResponse BearFramework\App\Request $request )
    public 
string getURL string $filename [, array $options = [] ] )
    public 
bool hasEventListeners string $name )
    public 
self removeEventListener string $name , callable $listener )

}
Properties
public readonly string $pathPrefix
The prefix of the assets URLs.
Methods
public self addDir ( string $pathname )
Registers a directory that will be publicly accessible.
public self addEventListener ( string $name , callable $listener )
Registers a new event listener.
public self dispatchEvent ( string $name [, mixed $details ] )
Calls the registered listeners (in order) for the event name specified.
public string|null getContent ( string $filename [, array $options = [] ] )
Returns the content of the file specified.
public array getDetails ( string $filename , array $list )
Returns a list of details for the filename specified.
Creates a response object for the asset request.
public string getURL ( string $filename [, array $options = [] ] )
Returns a public URL for the specified filename.
public bool hasEventListeners ( string $name )
Returns TRUE if there are registered event listeners for the name specified, FALSE otherwise.
public self removeEventListener ( string $name , callable $listener )
Removes a registered event listener.
Events
BearFramework\App\Assets\BeforeGetDetailsEvent beforeGetDetails
An event dispatched before the details of the asset specified is created.
BearFramework\App\Assets\BeforeGetURLEvent beforeGetURL
An event dispatched before the URL of the asset specified is created.
BearFramework\App\Assets\BeforePrepareEvent beforePrepare
An event dispatched before the asset specified is prepared for returning (resized for example).
BearFramework\App\Assets\GetDetailsEvent getDetails
An event dispatched after the details of the asset specified is created.
BearFramework\App\Assets\GetURLEvent getURL
An event dispatched after the URL of the asset specified is created.
BearFramework\App\Assets\PrepareEvent prepare
An event dispatched after the asset specified is prepared for returning (resized for example)
Details
Location: ~/src/App/Assets.php
The information on this page is created for version 1.1 of Bear Framework and may not be applicable for other versions of the framework.