PHP code example of igorw / file-serve-bundle

1. Go to this page and download the library: Download igorw/file-serve-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

igorw / file-serve-bundle example snippets


public function registerBundles()
{
    $bundles = array(
        // ...
        new Igorw\FileServeBundle\IgorwFileServeBundle(),
        // ...
    );
    // ...
}

$response = $this->get('igorw_file_serve.response_factory')->create('../VERSION', 'text/plain');

$options = array(
    'serve_filename' => 'VERSION.txt',
    'absolute_path' => true,
    'inline' => false,
);

$response = $this->get('igorw_file_serve.response_factory')
    ->create('../VERSION', 'text/plain', $options);