https://github.com/jaxon-php/jaxon-latte
Jaxon view renderer for Latte templates
https://github.com/jaxon-php/jaxon-latte
Last synced: about 2 months ago
JSON representation
Jaxon view renderer for Latte templates
- Host: GitHub
- URL: https://github.com/jaxon-php/jaxon-latte
- Owner: jaxon-php
- License: bsd-3-clause
- Created: 2017-05-07T14:11:28.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2024-12-14T00:14:31.000Z (7 months ago)
- Last Synced: 2025-04-02T07:41:27.007Z (3 months ago)
- Language: PHP
- Size: 20.5 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 Latte
====================Render views with the [Latte template engine](https://latte.nette.org/) in Jaxon applications.
Installation
------------Install this package with Composer.
```json
"require": {
"jaxon-php/jaxon-latte": "~3.0"
}
```Usage
-----Foreach directory containing Latte templates, add an entry to the `app.views` section in the configuration.
```php
'app' => [
'views' => [
'demo' => [
'directory' => '/path/to/demo/views',
'extension' => '.latte',
'renderer' => 'latte',
],
],
],
```In the application classes, this is how to render a view in this directory.
```php
class MyClass extends \Jaxon\CallableClass
{
public function action()
{
$this->response->html('content-id', $this->view()->render('demo::/sub/dir/file'));
return $this->response;
}
}
```Read the [documentation](https://www.jaxon-php.org/docs/v3x/advanced/views.html) to learn more about views in Jaxon applications.