Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/basemax/twigphpnocomposer
A ready-to-use example for using Twig template engine without needing to Composer in PHP.
https://github.com/basemax/twigphpnocomposer
composer php php-template php-twig template template-php template-project template-repository twig twig-3 twig-php twig-templates twig3 twigphp
Last synced: 1 day ago
JSON representation
A ready-to-use example for using Twig template engine without needing to Composer in PHP.
- Host: GitHub
- URL: https://github.com/basemax/twigphpnocomposer
- Owner: BaseMax
- License: gpl-3.0
- Created: 2022-07-07T10:16:59.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-02T11:26:38.000Z (over 2 years ago)
- Last Synced: 2025-02-04T07:15:42.528Z (7 days ago)
- Topics: composer, php, php-template, php-twig, template, template-php, template-project, template-repository, twig, twig-3, twig-php, twig-templates, twig3, twigphp
- Language: PHP
- Homepage:
- Size: 150 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Twig PHP (Without Composer)
A ready-to-use example for using Twig template engine without needing to **Composer** in **PHP**.
### Story of this Twig example
**Twig** is one of the popular and good engines which is suitable for most needs for templates. But the main problem is that it's a complex library and there are many sub directories and files. You have to use Composer in your project.
So what about if your current code bases is not going to use Composer?
Yeah, so this is the goal of this repository to provide a ready to use example for using Twig without Composer. so easily can use latest version of Twig without needing to Composer.
### Using
```sh
$ php example.php
```### Twig Version
In the current time, the latest version of Twig is 3.4.1, if you are trying to use this template in future maybe you can check https://github.com/twigphp/Twig/tags page to use the latest version.
For example you can download latest version as ZIP file. such as https://github.com/twigphp/Twig/archive/refs/tags/v3.4.1.zip
### Demo
**Input:**
```
Hello {{ name }}!
```**Output:**
```
Hello Max!
```### Performance
The takes time to include files and run the engine and print the example output was 0.0048439502716064s which is super fast.