https://github.com/jaxon-php/jaxon-twig
Jaxon view renderer for Twig templates
https://github.com/jaxon-php/jaxon-twig
Last synced: about 2 months ago
JSON representation
Jaxon view renderer for Twig templates
- Host: GitHub
- URL: https://github.com/jaxon-php/jaxon-twig
- Owner: jaxon-php
- License: bsd-3-clause
- Created: 2017-05-04T23:51:37.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2024-12-14T00:14:30.000Z (7 months ago)
- Last Synced: 2025-04-02T07:41:30.571Z (3 months ago)
- Language: PHP
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Jaxon View for Twig
===================Render Twig templates in Jaxon applications.
Installation
------------Install this package with Composer.
```json
"require": {
"jaxon-php/jaxon-twig": "~2.0"
}
```Usage
-----Foreach directory containing Twig templates, add an entry to the `app.views` section in the configuration.
```php
'app' => array(
'views' => array(
'demo' => array(
'directory' => '/path/to/demo/views',
'extension' => '.html.twig',
'renderer' => 'twig',
),
),
),
```In the application classes, this is how to render a view in this directory.
```php
$this->view()->render('demo::/sub/dir/file');
```Read the [documentation](https://www.jaxon-php.org/docs/armada/views.html) to learn more about views in Jaxon applications.