2017 © Pedro Peláez
 

silverstripe-module silverstripe-manifestassets

Get the path of an asset from a generated assets manifest file.

image

jacobbuck/silverstripe-manifestassets

Get the path of an asset from a generated assets manifest file.

  • Saturday, May 27, 2017
  • by jacobbuck
  • Repository
  • 1 Watchers
  • 1 Stars
  • 2,144 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 21 % Grown

The README.md

silverstripe-manifestassets

Get the path of an asset from a generated assets manifest file., (*1)

Usage

In your template you can get the url to your asset:, (*2)

<script src="$ManifestAsset('awesome.js')" type="application/javascript"></script>

It also works with Requirements:, (*3)

<% require js($ManifestAsset('awesome.js')) %>

To get the url to your asset in PHP:, (*4)

$pathToAwesomeJs = ManifestAssets::getPath('awesome.js');

Configuration

In your site config, you'll must configure a base path to your assets manifest file:, (*5)

ManifestAssets:
  base_path: themes/awesome/dist/js

By default it looks for a manifest.json file, but if you have a different name:, (*6)

ManifestAssets:
  base_path: themes/awesome/dist/js
  file_name: assets.json

Requirements

  • Silverstripe 3+

Installation

The recommended way to install is through Composer:, (*7)

composer require jacobbuck/silverstripe-manifestassets

The Versions

27/05 2017

dev-master

9999999-dev

Get the path of an asset from a generated assets manifest file.

  Sources   Download

The Requires

 

by Jacob Buck

assets theme silverstripe webpack manifest

26/05 2017

1.0.0

1.0.0.0

Get the path of an asset from a generated assets manifest file.

  Sources   Download

The Requires

 

by Jacob Buck

assets theme silverstripe webpack manifest