pug-php / pug-phalcon
HAML-like template engine for phalcon
Fund package maintenance!
kylekatarnls
Open Collective
Tidelift
Installs: 2 049
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=5.3.0
- pug-php/pug: ^1.11 || ^2.0.0 || ^3.0.0
Replaces
- kylekatarnls/jade-phalcon: 1.2.0
README
Pug Template Engine for Phalcon
To use Pug with your Phalcon application, just add to composer.json, in the require section:
"pug-php/pug-phalcon": "^1.0"
Or use the command line:
composer require pug-php/pug-phalcon
Then register the template:
require '../vendor/autoload.php'; // ... $di = new FactoryDefault(); // Setting up the view component $di['view'] = function() { $view = new View(); $view->setViewsDir('../app/views/'); $view->registerEngines(array( ".pug" => function($view, $di) { return new \Phalcon\Mvc\View\Engine\Pug($view, $di, array( 'cache' => '/tmp/myproject/pug', 'prettyprint' => APP_ENV == 'development', )); } )); return $view; };
Now you can add pug files in the views directory:
app/views/index.pug:
doctype html html head title pug-phalcon body p Generetad with pug-phalcon