https://github.com/silassare/otpl-php
A simple & lightweight template system: write once compile everywhere with JavaScript, PHP ...
https://github.com/silassare/otpl-php
otpl php template template-engine
Last synced: about 2 months ago
JSON representation
A simple & lightweight template system: write once compile everywhere with JavaScript, PHP ...
- Host: GitHub
- URL: https://github.com/silassare/otpl-php
- Owner: silassare
- License: mit
- Created: 2018-10-17T14:51:04.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-12-19T15:02:58.000Z (5 months ago)
- Last Synced: 2025-03-24T14:18:00.015Z (2 months ago)
- Topics: otpl, php, template, template-engine
- Language: PHP
- Homepage:
- Size: 131 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# OTPL
A simple template system, write once run everywhere with JavaScript (nodejs or in browser ), PHP ...
## Your contributions are welcomed
- [JS Project](https://github.com/silassare/otpl-js/)
- [PHP Project](https://github.com/silassare/otpl-php/)## Setup with composer
```sh
$ composer require silassare/otpl-php
```## Use case
### Input: your template.otpl file content
```html
<% $.label.text %>
/>
```### Usage: php
```php
parse('template.otpl');
$data = array(
'label' => array(
'text' => 'Your password please :',
),
'input' => array(
'id' => 'pass_field',
'type' => 'password',
'name' => 'pass'
)
);$otpl->runWith($data);
```
### Output
```html
Your password please :```