public function addExtension(Twig_ExtensionInterface $extension)
    {
        if ($this->extensionInitialized) {
            throw new LogicException(sprintf('Unable to register extension "%s" as extensions have already been initialized.', $extension->getName()));
        }

        $this->extensions[$extension->getName()] = $extension;
    }
public function addExtension(Twig_ExtensionInterface $extension)
    {
        if ($this->extensionInitialized) {
            throw new LogicException(sprintf('Unable to register extension "%s" as extensions have already been initialized.', $extension->getName()));
        }

        $this->extensions[$extension->getName()] = $extension;
    }
public function addExtension ( Twig_ExtensionInterface $ extension ) { if ( $ this -> extensionInitialized ) { throw new LogicException ( sprintf ( 'Unable to register extension "%s" as extensions have already been initialized.' , $ extension -> getName ( ) ) ) ; } $ this -> extensions [ $ extension -> getName ( ) ] = $ extension ; }
Registers an extension.

@param Twig_ExtensionInterface $extension A Twig_ExtensionInterface instance
Registers an extension .