1. Go to this page and download the library: Download naingaunglwin-dev/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/ */
naingaunglwin-dev / view example snippets
{
""naingaunglwin-dev/view": "^1.0"
}
}
AL\View\View;
$view = new View(__DIR__ . '/views');
// You can pass view file without extension if it is php file
$view->render('index', ['status' => 'success']);
// You can also render other file,
// You can retrieve the view without rendering,
$indexView = $view->render('index.html', [], true);
// You can also render multi views
$view->render(['index.html, test']);
//one.php
echo 'this is one.php';
$this->yield('content');
//two.php
$this->extends('one'); // view file name that need to extend
$this->section('content'); // Section start with `content` name
echo '<br>This is section content from two.php';
$this->end('content'); // End the section `content`
AL\View\View;
$view = new View(__DIR__ . '/views');
$view->render('two');
$view = new \NAL\View\View('path', MyCustomEngine::class);
$view->render('template'); // MyCustomEngine`s render method will be used in this process if exists
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.