05/03
2016
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:, (*1)
$ composer require massmedia/files_finder_bundle
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation., (*2)
Then, enable the bundle by adding it to the list of registered bundles
in the app/AppKernel.php
file of your project:, (*3)
<?php // app/AppKernel.php // ... class AppKernel extends Kernel { public function registerBundles() { $bundles = array( // ... new JMS\SerializerBundle\JMSSerializerBundle(), new FOS\RestBundle\FOSRestBundle(), new Nelmio\ApiDocBundle\NelmioApiDocBundle(), new Massmedia\FilesFinderBundle\FilesFinderBundle(), new Bazinga\Bundle\RestExtraBundle\BazingaRestExtraBundle(), ); // ... } // ... }
Routes file:, (*4)
# app/config/routing.yml NelmioApiDocBundle: resource: "@NelmioApiDocBundle/Resources/config/routing.yml" prefix: /api/doc
Configure rest:, (*5)
# app/config/config.yml fos_rest: param_fetcher_listener: true body_listener: true view: view_response_listener: 'force' format_listener: rules: - { path: ^/api, priorities: [ json ], fallback_format: json, prefer_extension: true } - { path: '^/', priorities: [ 'html', '*/*'], fallback_format: ~, prefer_extension: true }