PHP code example of erykai / template

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

    

erykai / template example snippets


$path =  __DIR__ . '/public/theme';
define('TEMPLATE_PATH', $path);
const TEMPLATE_URL = 'https://lvh.me';
const TEMPLATE_CLIENT = 'client';
const TEMPLATE_DEFAULT = 'default';
const TEMPLATE_DASHBOARD = 'admin';
const TEMPLATE_REGEX_GLOBAL = '/{{([A-Z_]+)}}/';
const TEMPLATE_REGEX_TEXT = '/{{([a-zA-Zà-úÀ-Ú0-9|-|_|?!.,\' ]+)}}/';
const TEMPLATE_REGEX_ROUTE = '/{{#(\/[a-z-]+[\/|[a-z])+#}}/';

const TRANSLATE_PATH = 'translate';
const TRANSLATE_API_KEY = null;
const TRANSLATE_API_URL = 'https://translate.erykia.com/api/v1';
const TRANSLATE_DEFAULT = 'pt-BR';


use Erykai\Template\Template;
$T = new Template(TEMPLATE_DASHBOARD);

$T->nav("index","pages/home");
echo $T->getIndex();