Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shusaura85/mythtpl
Easy to use template system for PHP
https://github.com/shusaura85/mythtpl
php php-library php7 raintpl template-engine
Last synced: about 1 month ago
JSON representation
Easy to use template system for PHP
- Host: GitHub
- URL: https://github.com/shusaura85/mythtpl
- Owner: shusaura85
- License: mit
- Created: 2022-04-14T09:20:21.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-02T13:14:48.000Z (over 1 year ago)
- Last Synced: 2024-11-23T21:11:28.694Z (about 2 months ago)
- Topics: php, php-library, php7, raintpl, template-engine
- Language: PHP
- Homepage:
- Size: 82 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: LICENSE
Awesome Lists containing this project
README
MythTPL
=========By Shu Saura
Based on RainTPL 3 by Federico Ulfo[MythTPL](https://github.com/shusaura85/mythtpl) is an easy template engine for PHP that allows easy separation of the presentation from the logic.
Features
--------
* Simple syntax
* Easy to use
* Fast, templates are compiled to plain PHP code
* Powerful, modifiers and operations with variables
* Extensible, you can register new tagsSupported tags
--------
* {$variable} to include a variable in the template
* {#CONSTANT} or {#'string'} to include a constant or string
* {if} for conditional blocks
* {loop} to loop over arrays
* {include} to include another template
* {ignore} to add private comments in the template
* {noparse} to not process tags contained inside
* {function} to run a PHP function
* {php} if you really must use PHP inside your templates (disabled by default in configuration)
* {autoescape} to automatically escape all tag values inside
* {elseif} {else} {break} {continue} to use with conditional or looping tagsInstallation / Usage
--------------------* Using **Composer**
``` shell
composer require shusaura85/mythtpl
```
* Manually``` php
require '/path/to/src/autoload.php'
```Requirements
-------------
MythTPL requires at least `PHP 7.4` to work. MythTPL has no external dependencies.Differences compared to Rain TPL 3
----------------------------------
* Dropped plugin support
* Dropped function blacklist
* assign() now accepts only arrays (use assign_var() to set a single value)
* Configuration is no longer static, you can now configure with constructor or dedicated configuration functions
* Added reset() function to clear assigned values
* Added p_assign() function to assign values that are not cleared with reset()Licence
-------MythTPL is published under the MIT Licence, see `LICENSE` file for details.