Theme engines are currently a single file that defines some callbacks (including the not-confusingly-named-at-all hook_init()).

We could convert them to an interface, then implementations of the interface. Should be a reasonably simple patch.

Comments

Crell’s picture

Wouldn't this be redundant is the Twig conversion goes forward? Realistically multiple theme engines don't exist anyway and haven't for a long time.

catch’s picture

Twig will be implemented as a theme engine, and there's another issue to remove multiple theme engine support entirely, which wasn't well supported, so unless we explicitly go out of our way to kill it, we could do this. The amount of code actually supporting multiple theme engines is minimal.

Crell’s picture

If we nominally have multiple theme engines then making them classes make sense. I still think we need to just admit that we already don't support multiple theme engines. :-)

fubhy’s picture

I would agree with #3. We should simply kill support for multiple theme engines altogether. Even if the code required to make this work is minimal it's still code that we don't need and it makes things more complicated.

Also... Let's be realistic, how many modules support anything else than phptemplate currently? And... how many modules will support anything but Twig in the future? If we believe Twig was the right decision (and I do so) than we should be bold about it and simply assume that everyone is going to use it (because they should!).

@catch:
You mentioned that there was an issue for this already... I couldn't find it. Can you post a link here? :)

fubhy’s picture

star-szr’s picture

Issue summary: View changes
Status: Active » Closed (duplicate)

Closing in favour of the more active #1685492: Convert theme engines into services.