2017 © Pedro Peláez
 

library rdn-asset

Zend Framework 2 simple asset publishing module

image

radnan/rdn-asset

Zend Framework 2 simple asset publishing module

  • Tuesday, February 18, 2014
  • by radnan
  • Repository
  • 1 Watchers
  • 1 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

RdnAsset

The RdnAsset ZF2 module provides a very simple way to publish the public assets for all your modules., (*1)

How to install

  1. Use composer to require the radnan/rdn-asset package:, (*2)

    $ composer require radnan/rdn-asset:1.*
    
  2. Activate the module by including it in your application.config.php file:, (*3)

    ~~~php array( 'RdnAsset', // ... ), ); ~~~ ## How to use Create a `public/` directory in your module's root and place all your public assets there. Then, simply run the following command from your project root: ~~~bash $ vendor/bin/console asset:publish ~~~ This will publish the module's assets to your project root's `public/modules/` directory. Now, you can include assets from this module by using the path `/modules//`. For example, in your view file you could do the following: ~~~php headLink() ->appendStylesheet($this->basePath('/modules/rdn-asset/css/foo.css')) ?>, (*4)


## Asset source By default, we assume assets are located in the `<module-root>/public/` directory. If this is not true for a module, you can implement the `getPublicPath()` method on it which should return the actual path to its assets: ~~~php namespace App; class Module { public function getPublicPath() { return 'module/app/public-foo'; } }

Publish path

Assets are published to the <project-root>/public/modules/ directory. By default, the Symlink adapter is used to publish the assets. Assets are grouped by their module name and the module name is converted into dash-case to follow the standard asset naming conventions., (*5)

You can change this publish path by using the following configuration:, (*6)

<?php

return array(
    'rdn_asset' => array(
        'target_path' => 'public/modules-foo',
    ),
);

Asset cleanup

You can remove assets that no longer exist by using the --prune option:, (*7)

$ vendor/bin/console asset:publish --prune

The Versions

18/02 2014

dev-master

9999999-dev

Zend Framework 2 simple asset publishing module

  Sources   Download

MIT

The Requires

 

by Avatar radnan

zf2 zend asset publish

16/02 2014

v1.0.0

1.0.0.0

Zend Framework 2 simple asset publishing module

  Sources   Download

MIT

The Requires

 

by Avatar radnan

zf2 zend asset publish