PHP code example of fastpress / view

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

    

fastpress / view example snippets


$app = ['template' => ['views' => '/path/to/views/', 'layout' => '/path/to/layout/']];
$view = new \Fastpress\View\View($app);

$view->set('option', 'value');

$view->render('viewFile.php', ['variable' => 'value']);

$view->extend('layoutFile');

$view->block('blockName');
// ... HTML and PHP content here ...
$view->endblock('blockName');

$view->content('blockName');

$view->layout('layoutFile');