Tale\Jade\Renderer::__construct PHP Method

__construct() public method

Use the ->render() method on the resulting object to render your jade files Possible options are: adapter: The name of the adapter to use, either a short-name for an internal adapter or a class-name for a custom adapter adapter_options: The option-array that gets passed to the adapter compiler: The compiler-options that get passed to the compiler parser_options: The parser-options that get passed to the parser lexer_options: The lexer options that get passed to the lexer pretty: Compile with indentations and newlines (default: false) paths: The paths the compiler should search the jade files in
public __construct ( array $options = null, Compiler $compiler = null, Parser $parser = null, Lexer $lexer = null )
$options array the options to pass to the renderer
$compiler Compiler the compiler to use inside the renderer
$parser Parser the parser to use inside the compiler
$lexer Lexer the lexer to use inside the parser
    public function __construct(array $options = null, Compiler $compiler = null, Parser $parser = null, Lexer $lexer = null)
    {
        $this->defineOptions(['adapter' => 'file', 'adapter_options' => [], 'compiler_options' => [], 'parser_options' => [], 'lexer_options' => []], $options);
        //Quick Options.
        //These get passed to the actual option arrays of the related objects
        //@DEPRECATED lifeTime and cachePath will be removed in the near future!
        $this->forwardOption('lifeTime', 'adapter_options', 'ttl');
        $this->forwardOption('ttl', 'adapter_options');
        $this->forwardOption('cachePath', 'adapter_options', 'path');
        $this->forwardOption('cache_dir', 'adapter_options', 'path');
        $this->forwardOption('cache_path', 'adapter_options', 'path');
        $this->forwardOption('paths', 'compiler_options');
        $this->forwardOption('pretty', 'compiler_options');
        $this->forwardOption('indent_style', 'compiler_options');
        $this->forwardOption('indent_width', 'compiler_options');
        $this->forwardOption('stand_alone', 'compiler_options');
        $this->forwardOption('extensions', 'compiler_options');
        $this->forwardOption('mode', 'compiler_options');
        $this->forwardOption('doctypes', 'compiler_options');
        $this->forwardOption('filters', 'compiler_options');
        $this->forwardOption('filter_map', 'compiler_options');
        $this->lexer = $lexer ?: new Lexer($this->options['lexer_options']);
        $this->parser = $parser ?: new Parser($this->options['parser_options'], $this->lexer);
        $this->compiler = $compiler ?: new Compiler($this->options['compiler_options'], $this->parser);
    }