Documentation

Packages
in package

Helps manage asset URLs.

Tags
author

Fabien Potencier fabien@symfony.com

author

Kris Wallsmith kris@symfony.com

Table of Contents

Properties

$defaultPackage  : mixed
$packages  : array<string|int, mixed>

Methods

__construct()  : mixed
addPackage()  : mixed
getPackage()  : PackageInterface
Returns an asset package.
getUrl()  : string
Returns the public path.
getVersion()  : string
Gets the version to add to public URL.
setDefaultPackage()  : mixed

Properties

$defaultPackage

private mixed $defaultPackage

$packages

private array<string|int, mixed> $packages = []

Methods

getUrl()

Returns the public path.

public getUrl(string $path[, string|null $packageName = null ]) : string

Absolute paths (i.e. http://...) are returned unmodified.

Parameters
$path : string

A public path

$packageName : string|null = null

The name of the asset package to use

Return values
string

A public path which takes into account the base path and URL path

getVersion()

Gets the version to add to public URL.

public getVersion(string $path[, string|null $packageName = null ]) : string
Parameters
$path : string

A public path

$packageName : string|null = null

A package name

Return values
string

        
On this page

Search results