erykai / template
Populate template
Fund package maintenance!
Erykai
Requires
- php: >=8.0
- erykai/translate: v2.2.3
README
Populate template
create config.php
$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])+#}}/';
create translate.php
const TRANSLATE_PATH = 'translate'; const TRANSLATE_API_KEY = null; const TRANSLATE_API_URL = 'https://translate.erykia.com/api/v1'; const TRANSLATE_DEFAULT = 'pt-BR';
example create path "public/theme/admin/index.html" insert in index.html
<html lang="{{LANG}}"> <link rel="stylesheet" href="{{TEMPLATE_URL}}/public/theme/{{TEMPLATE_DASHBOARD}}/assets/css/style.css"> <script src="{{TEMPLATE_URL}}/public/theme/{{TEMPLATE_DASHBOARD}}/assets/script.js"></script> <h1>{{Hello World}}</h1> <a href="{{TEMPLATE_URL}}{{#/about#}}">{{About}}</a> <a href="{{TEMPLATE_URL}}{{#/client/login#}}">{{Login}}</a>\
and "public/theme/admin/pages/home.html" insert in home.html
<h2>{{Home}}</h2> <a href="{{TEMPLATE_URL}}{{#/contact#}}">{{Contact}}</a>
require "config.php"; require "translate.php"; require "vendor/autoload.php"; use Erykai\Template\Template; $T = new Template(TEMPLATE_DASHBOARD); $T->nav("index","pages/home"); echo $T->getIndex();
Contribution
All contributions will be analyzed, if you make more than one change, make the commit one by one.
Support
If you find defaults send an email reporting to webav.com.br@gmail.com.
Credits
- Alex de O. Vidal (Developer)
- All contributions (Contributors)
License
The MIT License (MIT). Please see License for more information.