PHP Class Hostnet\Bundle\WebpackBundle\Twig\TwigExtension

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

Public Methods

Method 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 method

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 method

public getFunctions ( )

getName() public method

public getName ( )

getTokenParsers() public method

public getTokenParsers ( )

webpackAsset() public method

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
return array

webpackCommonCss() public method

Example: "/.css".
public webpackCommonCss ( ) : string
return string

webpackCommonJs() public method

Example: "/.js".
public webpackCommonJs ( ) : string
return string

webpackPublic() public method

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
return string