What I have now is existing code that I suppose in a way is a framework of sorts in itself. It has some "main" script files that get called on every request and amount themselves to being configuration of the main application + user login and session maintenance. URL "routing" is tied to the file system.
The application has "modules", which are not the same kind as "ZF2 modules". My (non-ZF2) modules work as such: you call $domain/module.php?module=<module_name> <module_name> is then an actual file called module_name.php. That file has all the HTML, PHP, SQL, JS needed to run the "module". It may be an actual single file. It can be a single file that pulls in and calls many others. I would like for my app to be as much ZF2 as possible, but I am not sure how to negotiate ZF2 event-firing mechanism, without significantly rewriting everything that I have. What I resolved to doing for now, at the least, I started using partial view helpers where I can. I had to do some hacks to enable $this->partial() functions inside my scattered PHP scripts, but after that, my partials work as expected. I am now thinking of using typical ViewModel templates as a step towards ZF2 MVC model. I will need to do some hacks to make that work, but I sense that it is doable. I feel though that using ViewModel() will be just a little step towards ZF2, in essence encapsulating HTML-like code, but not getting me significantly closer to the spirit of ZF2. I have an opportunity now where I am adding a new "module", to try to make the module to be as much in tune with ZF2 MVC flow as possible, without having to do major rewrites. Aside from using ViewModel() to abstract away the "view", is there anything else reasonably simple that I can do to move myself closer to ZF2 framework? -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/Incorporating-ZF2-into-existing-non-framework-code-tp4662084.html Sent from the Zend Framework mailing list archive at Nabble.com. -- List: [email protected] Info: http://framework.zend.com/archives Unsubscribe: [email protected]
