PHP code example of lukman-ss / view

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

    

lukman-ss / view example snippets


use Lukman\View\FileViewFinder;
use Lukman\View\PhpEngine;
use Lukman\View\ViewFactory;

$finder = new FileViewFinder([__DIR__ . '/views']);
$engine = new PhpEngine();
$view = new ViewFactory($finder, $engine);

echo $view->render('home', ['name' => 'Lukman']);

Hello,  echo $e($name); 

echo $view->render('pages.home');

$finder->addNamespace('admin', __DIR__ . '/views/admin');

echo $view->render('admin::dashboard.index');

$view->share('appName', 'Demo');
$view->share(['locale' => 'en']);

echo $view->render('home', ['appName' => 'Override']);

<title> echo $section('title', 'Default'); 

 $extend('layouts.app'); 

 echo $

 echo $e($value);