PHP code example of rush / view-strategies

1. Go to this page and download the library: Download rush/view-strategies 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/ */

    

rush / view-strategies example snippets




use Rush\View;

View::configure([
    'base_path' => '/path/to/view',
    'default_extension' => 'php',
    'strategies' => [
        'php' => 'View\\Strategy\\Plate',
        'jade' => 'View\\Strategy\\Jade',
    ],
]);

echo new View('index.php')->render([ 'name' => 'John', 'age' => 30 ]);
echo new View('relative/path/to/view.jade')->render();