Ejemplo n.º 1
0
 public function __construct()
 {
     $parser = new Parser(new Lexer());
     $dumper = new PHPDumper();
     $dumper->registerVisitor('tag', new AutotagsVisitor());
     $this->jade = new Jade($parser, $dumper);
 }
Ejemplo n.º 2
0
 public function __construct()
 {
     $parser = new Parser(new Lexer());
     $dumper = new PHPDumper();
     $dumper->registerVisitor('tag', new AutotagsVisitor());
     $dumper->registerFilter('javascript', new JavaScriptFilter());
     $dumper->registerFilter('cdata', new CDATAFilter());
     $dumper->registerFilter('php', new PHPFilter());
     $dumper->registerFilter('style', new CSSFilter());
     $this->jade = new Jade($parser, $dumper);
 }
Ejemplo n.º 3
0
 /**
  * Create a new JadeCompiler instance.
  *
  * @param \Illuminate\Filesystem\Filesystem $files
  * @param string $cachePath
  */
 public function __construct(Filesystem $files, $cachePath)
 {
     parent::__construct($files, $cachePath);
     $this->dumper = new PHPDumper();
     $this->dumper->registerVisitor('tag', new AutotagsVisitor());
     $this->dumper->registerFilter('javascript', new JavaScriptFilter());
     $this->dumper->registerFilter('cdata', new CDATAFilter());
     $this->dumper->registerFilter('php', new PHPFilter());
     $this->dumper->registerFilter('style', new CSSFilter());
     $this->lexer = new Lexer();
     $this->parser = new Parser($this->lexer);
     $this->jade = new Jade($this->parser, $this->dumper);
 }
Ejemplo n.º 4
0
Archivo: jade.php Proyecto: wushian/MDD
 /**
  * Returns the Parser lib object
  *
  * @return  Jade\Parser
  */
 public static function parser()
 {
     if (!empty(static::$_parser)) {
         return static::$_parser;
     }
     $parser = new Jade\Parser(new Jade\Lexer\Lexer());
     $dumper = new Jade\Dumper\PHPDumper();
     $dumper->registerVisitor('tag', new Jade\Visitor\AutotagsVisitor());
     $dumper->registerFilter('javascript', new Jade\Filter\JavaScriptFilter());
     $dumper->registerFilter('cdata', new Jade\Filter\CDATAFilter());
     $dumper->registerFilter('php', new Jade\Filter\PHPFilter());
     $dumper->registerFilter('style', new Jade\Filter\CSSFilter());
     static::$_jade = new Jade\Jade($parser, $dumper, static::$_cache);
     return static::$_jade;
 }
Ejemplo n.º 5
0
<?php

require './jade/autoload.php.dist';
use Everzet\Jade\Dumper\PHPDumper, Everzet\Jade\Visitor\AutotagsVisitor, Everzet\Jade\Filter\JavaScriptFilter, Everzet\Jade\Filter\CDATAFilter, Everzet\Jade\Filter\PHPFilter, Everzet\Jade\Filter\CSSFilter, Everzet\Jade\Parser, Everzet\Jade\Lexer\Lexer, Everzet\Jade\Jade;
$dumper = new PHPDumper();
$dumper->registerVisitor('tag', new AutotagsVisitor());
$dumper->registerFilter('javascript', new JavaScriptFilter());
$dumper->registerFilter('cdata', new CDATAFilter());
$dumper->registerFilter('php', new PHPFilter());
$dumper->registerFilter('style', new CSSFilter());
// Initialize parser & Jade
$parser = new Parser(new Lexer());
$jade = new Jade($parser, $dumper);
$template = __DIR__ . '/templates/index.jade';
$template_file = __DIR__ . '/templates/index.jade.php';
// Parse a template (both string & file containers)
echo "Parsing {$template} to  {$template_file}" . PHP_EOL;
file_put_contents($template_file, $jade->render($template));
$template = __DIR__ . '/templates/teacher.jade';
$template_file = __DIR__ . '/templates/teacher.jade.php';
echo "Parsing {$template} to  {$template_file}" . PHP_EOL;
file_put_contents($template_file, $jade->render($template));
$template = __DIR__ . '/templates/logout.jade';
$template_file = __DIR__ . '/templates/logout.jade.php';
echo "Parsing {$template} to  {$template_file}" . PHP_EOL;
file_put_contents($template_file, $jade->render($template));