File tree Expand file tree Collapse file tree 1 file changed +61
-0
lines changed
Expand file tree Collapse file tree 1 file changed +61
-0
lines changed Original file line number Diff line number Diff line change 1+ # Leaf Veins
2+
3+ Veins is a simple, lightweight, and fast templating engine for PHP. It is designed to be easy to use and easy to extend.
4+
5+ ## Installation
6+
7+ You can install Veins using the Leaf CLI:
8+
9+ ``` bash
10+ leaf install veins
11+ ```
12+
13+ Or with composer:
14+
15+ ``` bash
16+ composer require leafs/veins
17+ ```
18+
19+ ## Usage
20+
21+ ``` php
22+ <?php
23+
24+ require __DIR__ . '/vendor/autoload.php';
25+
26+ use Leaf\Veins;
27+
28+ $veins = new Veins();
29+ $veins->configure([
30+ 'templateDir' => __DIR__ . '/views/',
31+ 'cacheDir' => __DIR__ . '/cache/',
32+ ]);
33+ $veins->render('hello', ['name' => 'John']);
34+ ```
35+
36+ ``` html
37+ <!-- views/hello.php -->
38+ <h1 >Hello, {$name}!</h1 >
39+ ```
40+
41+ ## Configuration
42+
43+ You can configure Veins by passing an array to the ` configure ` method:
44+
45+ ``` php
46+ $veins->configure([
47+ 'checksum' => [],
48+ 'charset' => 'UTF-8',
49+ 'debug' => false,
50+ 'templateDir' => 'views/',
51+ 'cacheDir' => 'cache/',
52+ 'baseUrl' => '',
53+ 'phpEnabled' => false,
54+ 'autoEscape' => true,
55+ 'sandbox' => true,
56+ 'removeComments' => false,
57+ 'customTags' => [],
58+ ]);
59+ ```
60+
61+ Find the full documentation at [ leafphp.dev/modules/views/veins] ( https://leafphp.dev/modules/views/veins/ ) .
You can’t perform that action at this time.
0 commit comments