1. Go to this page and download the library: Download brbunny/brplates 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/ */
brbunny / brplates example snippets
use BrBunny\BrPlates\BrPlates;
class Controller
{
/** @var BrPlates; */
private $view;
public function __construct($path, $ext)
{
// $this->view = new BrPlates($path, $ext);
$this->view = new BrPlates($path); //Extension is optional
}
}
// Register a one-off function
$this->view->function("name", function ($params) {
// Type Code
});
// Get template from another directory
$this->view->path("profile", "./theme/profile");
//Use template
$this->view->show("profile::profile", ["user" => "Jow User"]);
// Remove template added
$this->view->removePath("profile");