PHP Class Hostnet\Bundle\WebpackBundle\Twig\TwigExtension

Author: Harold Iedema ([email protected])
Inheritance: extends Twig_Extension
Afficher le fichier Open project: hostnet/webpack-bundle Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( string $web_dir, string $public_path, string $dump_path, string $common_js, string $common_css )
getFunctions ( )
getName ( )
getTokenParsers ( )
webpackAsset ( string $asset ) : array Returns an array containing a 'js' and 'css' key that refer to the path of the compiled asset from a browser perspective.
webpackCommonCss ( ) : string Example: "/.css".
webpackCommonJs ( ) : string Example: "/.js".
webpackPublic ( string $url ) : string Returns the mapped url for the given resource.

Method Details

__construct() public méthode

public __construct ( string $web_dir, string $public_path, string $dump_path, string $common_js, string $common_css )
$web_dir string
$public_path string
$dump_path string
$common_js string
$common_css string

getFunctions() public méthode

public getFunctions ( )

getName() public méthode

public getName ( )

getTokenParsers() public méthode

public getTokenParsers ( )

webpackAsset() public méthode

Returns an array containing a 'js' and 'css' key that refer to the path of the compiled asset from a browser perspective.
public webpackAsset ( string $asset ) : array
$asset string
Résultat array

webpackCommonCss() public méthode

Example: "/.css".
public webpackCommonCss ( ) : string
Résultat string

webpackCommonJs() public méthode

Example: "/.js".
public webpackCommonJs ( ) : string
Résultat string

webpackPublic() public méthode

For example: given url: "@AppBundle/images/foo.png" real path: "AppBundle/Resources/public/images/foo.png" mapped to: "//app/images/foo.png" The mapped url is either a symlink or copied asset that resides in the directory.
public webpackPublic ( string $url ) : string
$url string
Résultat string