2017 © Pedro Peláez
 

library assetpicker-bundle

Symfony Bundle for [AssetPicker](https://github.com/netresearch/assetpicker)

image

netresearch/assetpicker-bundle

Symfony Bundle for [AssetPicker](https://github.com/netresearch/assetpicker)

  • Tuesday, October 11, 2016
  • by copitz
  • Repository
  • 5 Watchers
  • 0 Stars
  • 84 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

AssetPicker Symfony Bundle

This Symfony bundle provides the AssetPicker sources to Symfony Applications along with view helpers and a proxy controller., (*1)

Installation

  1. Install via composer, (*2)

    composer require assetpicker-bundle
  2. Enable the bundle, (*3)

  3. Add AssetPicker configuration to your app/config/config.yml, (*4)

    asset_picker:
        storages:
            entermediadb:
                adapter: entermediadb
                url: "http://em9.entermediadb.org/openinstitute"
                proxy: true
            github:
                username: "netresearch"
                repository: "assetpicker"
    
  4. (Optional) If you want to use the builtin proxy controller, you must include its routes into app/config/routing.yml - the correct proxy url will then be set automatically:, (*5)

    assetpicker_proxy:
        resource: "@AssetPickerBundle/Resources/config/routing.yml"
    
  5. Clear cache and install the assets, (*6)

    php app/console cache:clear
    php app/console assets:install
    

Usage

The bundle provides two twig functions: assetpicker_config and assetpicker_url. The first returns a JSON representation of the config from your app/config/config.yml (eventually with the proxy url added) and the second gives you the url to the picker.js inside your assets path (usually /web/bundles/assetpicker/js/picker.js). You can use them as follows:, (*7)

<script type="text/javascript" src="{{ assetpicker_url() }}"></script>
<script type="text/javascript">
    new AssetPicker({{ assetpicker_config() }});
</script> 
<button rel="assetpicker">Pick an asset</button>

The Versions

11/10 2016

dev-master

9999999-dev

Symfony Bundle for [AssetPicker](https://github.com/netresearch/assetpicker)

  Sources   Download

MIT

The Requires

 

11/10 2016

1.0.0

1.0.0.0

Symfony Bundle for [AssetPicker](https://github.com/netresearch/assetpicker)

  Sources   Download

MIT

The Requires