PHP code example of liquidbox / silex-plates

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

    

liquidbox / silex-plates example snippets


$app->register(new \LiquidBox\Silex\Provider\PlatesServiceProvider(), array(
    'plates.directory' => '/path/to/templates',
    'plates.folders' => array(
        'email' => '/path/to/email/templates',
    ),
));

// Add any additional folders
$app['plates']->addFolder('emails', '/path/to/emails');

// Load asset extension
$app['plates.extension_loader.asset']('/path/to/public');

// Create a new template
$template = $app['plates']->make('emails::welcome');

$app->register(new \LiquidBox\Silex\Provider\PlatesServiceProvider(), array(
    'plates.data' => array(
        'title' => 'Plates - Native PHP Templates',
    ),
    'plates.functions' => array(
        'uppercase' => function ($string) {
            return strtoupper($string);
        },
    ),
));