PHP code example of dabl / view

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

    

dabl / view example snippets


use Dabl\View\View;

View::addDirectory(__DIR__ . '/views');
$output = View::load(
    'view', // view name
    array(
        'my_param' => 'hello world' // param to be injecting into the view
    ),
    true // return output instead of sending output to browser
);
echo $output;

<div><?= $my_param