public function addExtension(ExtensionInterface $extension)
    {
        if (!in_array($extension, $this->extensions)) {
            $this->extensions[] = $extension;
            $options = Phug::getExtensionsOptions([$extension]);
            foreach ([$this, $this->getCompiler()] as $instance) {
                $instance->setOptionsRecursive($options);
            }

            $this->initCompiler();
        }
    }
public function addExtension(ExtensionInterface $extension)
    {
        if (!in_array($extension, $this->extensions)) {
            $this->extensions[] = $extension;
            $options = Phug::getExtensionsOptions([$extension]);
            foreach ([$this, $this->getCompiler()] as $instance) {
                $instance->setOptionsRecursive($options);
            }

            $this->initCompiler();
        }
    }
public function addExtension ( ExtensionInterface $ extension ) { if ( ! in_array ( $ extension , $ this -> extensions ) ) { $ this -> extensions [ ] = $ extension ; $ options = Phug :: getExtensionsOptions ( [ $ extension ] ) ; foreach ( [ $ this , $ this -> getCompiler ( ) ] as $ instance ) { $ instance -> setOptionsRecursive ( $ options ) ; } $ this -> initCompiler ( ) ; } }
Plug an Phug extension to Pug.

@param ExtensionInterface $extension
Plug an Phug extension to Pug .