https://github.com/pocesar/jade-kohana
Jade templating engine on Kohana
https://github.com/pocesar/jade-kohana
Last synced: about 1 year ago
JSON representation
Jade templating engine on Kohana
- Host: GitHub
- URL: https://github.com/pocesar/jade-kohana
- Owner: pocesar
- License: mit
- Created: 2013-09-27T02:36:58.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2013-09-29T16:50:44.000Z (over 12 years ago)
- Last Synced: 2024-10-18T06:28:26.891Z (over 1 year ago)
- Language: PHP
- Size: 133 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
jade-kohana
===========
Jade templating engine on Kohana. This module works by compiling `.jade` templates to PHP files.
All compiled files goes to the `application/cache/jade` folder (that must be created and chmod'ed properly)
Usage
===========
You have two options:
#### Use the JadeTemplate instead of ControllerTemplate
```php
// Will look for template.jade by default, that is in views/template.jade
class Controller_Index extends JadeTemplate
{
function action_index()
{
$this->template->greeting = 'Hello';
}
}
```
#### Load the Jade views manually through JadeView class
```php
class Controller_Index extends Controller
{
function action_index()
{
$this->response->body(JadeView::factory('path/to/file.jade'));
}
}
```
This module extends from `Kohana_Controller` and `Kohana_View`, so it's _almost_ a drop-in replacement for existing controllers and views, behaves exactly like a `View` and `$jadeView instanceof View` returns true
You can, in your `application` folder, change the default `View` to use `JadeView`, but it will break view rendering for PHP views.
#### Known limitations
* Jade errors won't display a line number, making it very hard to spot indentation errors
* The compiled code cache is very crude and relies only on file modification times
* Result compiled php file is messy (that is a PHP Jade limitation)