diff --git a/README.md b/README.md index a175f0a..2f77b9c 100644 --- a/README.md +++ b/README.md @@ -15,22 +15,24 @@ a listener in the "Module.php" of those modules which contain public assets. A very basic example, assuming your asset directory is called "public", looks like this: - use BaconAssetLoader\Asset\Collection as AssetCollection; - use Zend\Mvc\MvcEvent; - use Zend\EventManager\Event; +```php +use BaconAssetLoader\Asset\Collection as AssetCollection; +use Zend\Mvc\MvcEvent; +use Zend\EventManager\Event; - … +// ... - public function onBootstrap(MvcEvent $mvcEvent) - { - $sm = $mvcEvent->getApplication()->getServiceManager(); - $sm->get('BaconAssetLoader.AssetManager')->getEventManager()->attach( - 'collectAssetInformation', - function(Event $event) { - $event->getTarget()->addAssets(new AssetCollection(__DIR__ . '/public')); - } - ); - } +public function onBootstrap(MvcEvent $mvcEvent) +{ + $sm = $mvcEvent->getApplication()->getServiceManager(); + $sm->get('BaconAssetLoader.AssetManager')->getEventManager()->attach( + 'collectAssetInformation', + function(Event $event) { + $event->getTarget()->addAssets(new AssetCollection(__DIR__ . '/public')); + } + ); +} +``` Publishing assets in your build ------------------------------- @@ -38,4 +40,6 @@ When building your project, you likely want to publish all your assets into a single directory later accessible by your web-server. To do this, simply make the following call on your console: - php public/index.php baconassetloader publish-assets public +```sh +php public/index.php baconassetloader publish-assets public +```