PHP code example of assura / silex-maintenance

1. Go to this page and download the library: Download assura/silex-maintenance 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/ */

    

assura / silex-maintenance example snippets




$app->register(new Silex\Provider\TwigServiceProvider(), array(
    'twig.path' => __DIR__.'/../views',
));

$app->register(new Assura\Silex\Maintenance\MaintenanceServiceProvider(), array(
    'maintenance.enabled' => function() {
    	return file_exists(__DIR__.'/../maintenance.file');
    },
    'maintenance.content' => $app['twig']->render('maintenance.html.twig'),
));