[Agavi-Users] Recommended way to add a filter to a renderer in the view

7 views
Skip to first unread message

list...@shoan.net

unread,
Oct 8, 2012, 10:22:36 AM10/8/12
to Agavi Users Mailing List
Hi,

I am using Twig for a project and had to add a filter. Since
AgaviTwigRenderer::getEngine() is protected, there was no way to access
Twig_Environment. I looked at the code for the other renderers and all
of them are similar.

What is the recommended way to add filters to a renderer?

Peace,
Shoan.


_______________________________________________
users mailing list
us...@lists.agavi.org
http://lists.agavi.org/mailman/listinfo/users

David Zülke

unread,
Oct 15, 2012, 5:00:19 AM10/15/12
to Agavi Users Mailing List
Subclass the renderer, usually (initializing this at runtime would be quite the mess I guess).

David

Jan Schütze

unread,
Oct 15, 2012, 10:17:38 AM10/15/12
to Agavi Users Mailing List
Hi,

I am currently using this one:
https://gist.github.com/7ea87a96608f41e3a8af

It has a very simple extension for the normal agavi twig renderer,
which enables the developer to add an array of extensions in the
output_types.xml.

Regards,
Jan

--

http://dracoblue.net

Reply all
Reply to author
Forward
0 new messages