Question

I am working on a project and was wondering if anyone else has messed with the view model much. Im looking for some examples on how to inject other view models i.e header,footer content.

I already have the template and layout path switching Im just trying to figure out the best way to handle if I select layout1 and it has 3 footer content fields, and a slider so how would put a class in front of the render to gather and inject required data

EDIT Ok I guess I should clarify LOL .... slight ADHD where my mind wanders.

What should I listen for before injecting the viewmodels or can I do this in my onBootStrap() in my main module. I currently

$sites = $e->getApplication()->getServiceManager()->get('Application\Model\Sites');
$sr = $sites->getSiteByDomain();

Since many domains and/or subdomains can point to this and puts info in a session. Maybe im over thinking it and should just extend actionController like I did in ZF1

LOL PHP so many ways to do something ......

Thx for any pointers

Was it helpful?

Solution

There's two helpful links i can give you. One is the playground of Rob Allen alias Akrabat, you can find his playground right over here at github. The other one would be the official documentation which is nicely documented on this part.

If those don't help you, you should specify your question and show us what you've tried so far.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top