Skip to content

Stopi/jade-phalcon

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

jade-phalcon

Jade Template Engine for Phalcon

To use Jade with your Phalcon application, just add to composer.json, in the require section:

"kylekatarnls/jade-phalcon": "dev-master"

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(
        ".jade" => function($view, $di) {
            return new Jade($view, $di, array(
				'cache' => '/tmp/myproject/jade',
				'prettyprint' => APP_ENV == 'development',
            ));
        }
    ));
    return $view;
};

Now you can add jade files in the views directory:

app/views/index.jade:

doctype html
html
  head
    title jade-phalcon
  body
    p Generetad with jade-phalcon

About

Jade Template Engine for Phalcon

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%