 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Evan Coury's Blog: Module-specific layouts in Zend Framework 2
by Chris Cornutt May 11, 2012 @ 08:07:44
Evan Coury has a new Zend Framework 2 related blog post looking at how to use module specific layouts in your application (even though, technically, it's more related to the controller).
There's really no such thing as "module-specific" anything in ZF2, so what we're really talking about is the topmost namespace of the controller being dispatched. So in the case of MyModuleControllerSomeController, the topmost namespace would be MyModle. In most cases, this will be the name of a given module.
He gives a quick piece of sample code showing a "Module" class that attaches an event on the dispatch of its request. Inside this event, he grabs the controller (target) and updates the layout via a call to the "layout" method. This is all handled in the "init" method of the module, so it should "just work" when the module is used.
voice your opinion now!
module layout zendframework2 controller
Kevin Schroeder's Blog: Handling ZF2 FQ Dependency Setter Injections
by Chris Cornutt May 02, 2012 @ 09:54:09
Kevin Schroeder has a new post in his series looking at dependency injection in Zend Framework v2 applications. In this new post he shows how to work with setter injections that coordinate to properties in the class.
In a previous article I showed how you could pass in a fully qualified parameter name into the Dependency Injection Container (DiC) if you needed to be specific about where you need to have something injected. There is an alternate method here that is cleaner than what I did before.
He illustrates with a "Test" class that has a "$test" property and shows how to, using the ZendDi component, inject the class into the container. Using the "injections" configuration value, he uses the "setTest" method to push a value into the "Test" class instance in the "$test" variable.
voice your opinion now!
dependency injection container zendframework2 setter injection configuration
Matthew Weier O'Phinney's Blog: Why Modules?
by Chris Cornutt May 01, 2012 @ 08:04:20
Matthew Weier O'Phinnney has a new post to his blog filling in some additional details behind a series he's been doing on modules in the Zend Framework v2 releases. In this new post he answers the question "why modules?"
I've blogged about getting started with ZF2 modules, as well as about ZF2 modules you can already use. But after fielding some questions recently, I realized I should talk about why modules are important for the ZF2 ecosystem.
He covers some of the history of the idea, starting with the MVC rework/refactor of the framework and the desire from several people to have self-contained components that could be native to a ZF app. ZFv1 made it work (kinda) with Zend_Application, but it was difficult so solving this became a main focus of ZFv2. He illustrates with a "building block" metaphor based on his current blog site (currently being refactored too).
This kind of building-block development makes your job easier as a developer - and allows you to focus on the bits and pieces that make your site unique. As such, I truly feel that modules are the most important new feature of ZF2.
voice your opinion now!
zendframework2 modules building block focus
Kevin Schroeder's Blog: A little more advanced ZF2 EventManager usage
by Chris Cornutt April 24, 2012 @ 08:54:55
Kevin Schroeder has a new post to his his blog with a bit more advanced example of using the Zend Framework 2 EventManager to make global event triggers.
If you look at my previous post on the ZF2 EventManager class you might be tempted to think that you are limited only to listening to events for local instances of the event manager. But no, my friend, you would be wrong. The event manager actually provides access to a sort of global event manager. But it's more than that. This global event manager allows you to listen in on events for various targets.
He includes an example of how to use the EventManager in a specific namespace that's triggered based on a custom event. He attaches a custom class, "cls2", to a listener on his "ns1/cls1" class.
voice your opinion now!
zendframework2 eventmanager example tutorial global
Matthew Weier O'Phinney's Blog: Developing A ZF2 Blog
by Chris Cornutt April 04, 2012 @ 08:22:58
Matthew Weier O'Phinney has a new post to his blog walking you through the creation of his own Zend Framework 2 blogging platform that works with git branching and page generation to get the job done.
Why write something of my own? Well, of course, there's the fact that I'm a developer, and have control issues. Then there's also the fact that a blog is both a simple enough domain to allow easily experimenting with new technology and paradigms, while simultaneously providing a complex enough domain to expose non-trivial issues.
He realized that he wanted a platform that was not only something he wanted to maintain but that also allowed him to write how he wanted to write - no more in-browser editing, just working with text files and generated page output. He shares some of the thoughts behind the different parts of the blog software - the domain model, his PhlyBlog module and the updated code he used to override some of the functionality in this default module. He also describes his new blogging process which includes git branching, creating a PHP "post" file, regernerate the blog via a command-line tool and merge and deploy.
voice your opinion now!
develop blog zendframework2 tutorial phlyblog module git
Rob Allen's Blog: Access view variables in another view model
by Chris Cornutt April 03, 2012 @ 12:53:37
In this new post to his blog Rob Allen shows you how to access the view variables from another ViewModel.
Unlike Zend Framework 1, the view layer in Zend Framework 2 separates the variables assigned to each view model. This means that when you are in the layout view script, you don't automatically have access to variables that were assigned the the action's view model and vice versa.
He includes snippets of code with an example controller and a sample view that fetches a value from a child ViewModel instance. He also shows how to access layout and configuration values in the view.
voice your opinion now!
view model variables other scope child viewmodel zendframework2
|
Community Events
Don't see your event here? Let us know!
|