Friday, 13 September 2013

ZF2 how to display tweets in layout

ZF2 how to display tweets in layout

I'm developing a site using ZF2. One of the section in footer contains
tweets. I can fetch tweets but I am not sure how to display them in the
layout. I have following ideas but not sure which approach to use
Create a controller plugin and use it on each request.
Create a ViewHelper which fetches the tweets from the ServiceLocator and
call the helper in the layout
Attach an event to the MvcEvent::EVENT_RENDER in the module.php which sets
the html to a layout variable.
If there is anyother better approach, please let me know.

No comments:

Post a Comment