An open API service indexing awesome lists of open source software.

https://github.com/leafsphp/veins

Templating engine for Leaf PHP framework
https://github.com/leafsphp/veins

leaf leaf-veins leafphp php-template-engine template-engine

Last synced: about 2 months ago
JSON representation

Templating engine for Leaf PHP framework

Awesome Lists containing this project

README

        

# Leaf Veins

Veins is a simple, lightweight, and fast templating engine for PHP. It is designed to be easy to use and easy to extend.

## Installation

You can install Veins using the Leaf CLI:

```bash
leaf install veins
```

Or with composer:

```bash
composer require leafs/veins
```

## Usage

```php
configure([
'templateDir' => __DIR__ . '/views/',
'cacheDir' => __DIR__ . '/cache/',
]);
$veins->render('hello', ['name' => 'John']);
```

```html

Hello, {$name}!


```

## Configuration

You can configure Veins by passing an array to the `configure` method:

```php
$veins->configure([
'checksum' => [],
'charset' => 'UTF-8',
'debug' => false,
'templateDir' => 'views/',
'cacheDir' => 'cache/',
'baseUrl' => '',
'phpEnabled' => false,
'autoEscape' => true,
'sandbox' => true,
'removeComments' => false,
'customTags' => [],
]);
```

Find the full documentation at [leafphp.dev/modules/views/veins](https://leafphp.dev/modules/views/veins/).