ZF2 [ beta5 ] widget architecture with view helpers
I really like the View Helper concept but I want to create some kind of a widget architecture.
I've created some test classes as a proof of concept.
I have inherited from the Abstract View Helper class to create some Widget Classes. So far so good.
But then I got some problems, such as for example if I wanted to nest widgets.
After this I looked for other solutions
My new idea is to create a widget element like this pseudo code below
And parse the output and translate directly into HTML and echo it at the captureEnd() method, but this method is a little ugly
2. Inherit from the PhpRenderer and parsing the output in the render () method
Do I need to develop my own resolver and rendering Startegy when i inherit from Phprenderer or is it an easy task to do?
3. Injecting a filter chain object into the Phprenderer with setFilterChain () method
I like to test this approach but i havent found a solution to get the phprender instance.
How can i inject an output filter into the Phprenderer instance ? do i need to use a factoriy in the service_manager?
What is the best approach to go for ?
Are there any better/faster ways to parse the output ?
Re: ZF2 [ beta5 ] widget architecture with view helpers
This post has NOT been accepted by the mailing list yet.
thanks for the quick reply.
i've already read this thread. It describes how to put some placeholder in the layout and render them each.
But in my case i don't know how to use this since i want to bo able to use widgets in the differnt views an nest them and create them dynamic after parsing.
So my main question is what is the best way to parse the view.