Closed OnkelTem closed 5 years ago
Phug\Phug
is just a facade. You can call instances of Phug\Renderer
(or Pug\Pug
if using pug-php, pug-symfony, laravel-pug, etc.)
I tried to look up for implementations in other frameworks but they seem to be not using phug at all.
They all use Phug, because pug-php itself uses it since its version 3. And most examples with Pug\Pug
will also work with Phug\Renderer
, Pug\Pug
extends Phug\Renderer
and just add some options for backward-compatibility with pug-php 2 and add JS-style expressions (js-phpize).
I see, thank you very much. So to Renderer... And yeah, now it does make sense.
I'm developing a PHP data processing framework and I'm gonna add Phug as a plugin. When a plugin runs, it creates instances of underlying workers, e.g. twig example:
But with Phug I don't see how can I create an instance of its worker. The Phug class is static, setting options seems to set them globaly. But... why? Shouldn't it be an isolated thing, or what is reason of working with globals/singletons?
I tried to look up for implementations in other frameworks but they seem to be not using phug at all.