1. Go to this page and download the library: Download initphp/views 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/ */
$data = new stdClass;
$data->username = 'admin';
echo view('dashboard/profile', $data);
use \InitPHP\Views\Facade\View;
use \InitPHP\Views\Adapters\PurePHPAdapter;
$viewAdapter = new PurePHPAdapter(__DIR__ . '/Views/');
View::via($viewAdapter);
use \InitPHP\Views\Facade\View;
use \InitPHP\Views\Adapters\BladeAdapter;
$viewAdapter = new BladeAdapter(__DIR__ . '/Views/', __DIR__ . '/Cache/');
View::via($viewAdapter);
use \InitPHP\Views\Facade\View;
use \InitPHP\Views\Adapters\TwigAdapter;
$viewAdapter = new TwigAdapter(__DIR__ . '/Views/', __DIR__ . '/Cache/');
View::via($viewAdapter);