symfony/symfony — Issue #2999: Code duplication among Twig extensions and Templating helpers
Author: jmikola
Created: 2011-12-30 00:44:08+00:00
State: open

I was looking at the templating helper classes in FrameworkBundle and SecurityBundle. There appears to be a fair about of code duplication between these classes and their Twig extension counterparts.

I realize helpers extend a base class, as do Twig extensions, so separate classes must continue to exist; however, we could use object composition to have the Twig extensions expose the helper's methods to Twig. In some cases, this might require an intermediary wrapping method in the helper.