https://github.com/corviz/crow
Yet another template engine for PHP
https://github.com/corviz/crow
php php8 template-engine
Last synced: 19 days ago
JSON representation
Yet another template engine for PHP
- Host: GitHub
- URL: https://github.com/corviz/crow
- Owner: Corviz
- License: mit
- Created: 2022-05-18T12:44:34.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-14T04:11:49.000Z (3 months ago)
- Last Synced: 2025-04-09T16:55:08.481Z (19 days ago)
- Topics: php, php8, template-engine
- Language: PHP
- Homepage: https://corviz.github.io/crow/
- Size: 84 KB
- Stars: 6
- Watchers: 1
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Crow template engine
Yet another php template engine
Features:
* Easily extensible - You can create new methods to satisfy your needs
* Wide spread syntax (similar to Blade)
* Framework agnostic - You can use it in any project
* Easy to configure - It takes literally 2 commands to make a basic configuration (1 if you won't use components/custom
tags)
* MIT license. Free for commercial and non-commercial use## Installation with composer
```
composer require corviz/crow
```## Quickstart
In your main script:
```php
use Corviz\Crow\Crow;Crow::setDefaultPath('/path/to/templates/folder');
Crow::setComponentsNamespace('MyComponents'); //Required only if you will use components/custom tagsCrow::render('index');
```In /path/to/templates/folder/index.crow.php:
```html
Index
{{ 'Hello world' }}
```
## Basic loop example
In your main script:
```php
$todoList = ['Work', 'Clean house', 'Relax'];Crow::render('template', ['todoList' => $todoList]);
```Template file
```html
Todo:
- {{ $task }}
@foreach($todoList as $task)
@endforeach
```
## Credits
- Carlos A. B. Carucce - Development ([Github Profile](https://github.com/carloscarucce))
- Wiktor Stribiżew - Special thanks for the support with most regexes used in this project ([Stackoverflow](https://stackoverflow.com/users/3832970/wiktor-stribi%c5%bcew) / [YT Channel](https://www.youtube.com/channel/UCFeq5T-LNtqpVrn_rcJ9hFw))
## Like it?
Visit https://corviz.github.io/crow/ for documentation/examples