Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Rob Allen's Blog:
Some ZendView examples
Mar 12, 2012 @ 15:52:48

Following on the heels of the beta 3 release of the Zend Framework 2, Rob Allen has been posting more about its features and what's changed from the version 1 world. In this new post he looks at some examples of how to use the newly refactored ZendView component.

With the release of Beta 3 of Zend Framework, we now have a significantly refactored the ZendView component. One of the changes made is that there is a ViewModel object that is returned from a controller which contains the variables to be used within the view script along with meta information such as the view script to render. [...] However, we can do many more interesting things than this and I've put together a test application with a controller showing some of the things that can be done.

Included in the post includes two snippets of code from the sample project - how to change the layout in the action and creating another view model at the layout level.

tagged: zendframework2 zendview sample application zf2

Link:

3 Engineers Blog:
3 Step Layouts in Zend Framework
Apr 04, 2011 @ 18:04:06

In a recent post to the 3 Engineers blog, they take the usual "Two Step" approach the Zend Framework takes to generating view data (Zend_View + Zend_Layout) and takes it up one more step by using Three Step Layouts with a simple wrapper.

While the Two Step View pattern creates a reasonable paradigm for seperating layout presentation from page presentation, enabling Three-level Inheritance allows for even better separation. In other words, using 3 Step Layouts is a possible and often necessary investment to make when implementing front-ends in Zend Framework projects; they allow fine grain re-usability that provides for a DRYer presentation layer.

They have a three step process you can follow (complete with code snippets) that'll have you working with their 3 layers easily. The wrapper is a sort of "boostrap" for the layout. The nested layout is then pulled into this wrapper (for example's sake, theirs is called "default") and then the view can be served as normal and placed into the content location. There's also a bit of code showing how to switch out the layout if there's ever a need - like different layouts for the admin, user and main parts of your application.

tagged: zendframework twostep threestep layout wrapper view zendview zendlayout

Link:

Kevin Schroeder's Blog:
Integrating Zend_View with WordPress
Mar 22, 2011 @ 15:08:00

Kevin Schroeder has a recent post to his blog showing how he integrated Zend_View into a WordPress install for his blog. It was as a part of a plugin he uses on some of his internal pages.

I just read a blog post about integrating Zend Framework and WordPress and figured I'd add some commentary of my own, since I've done something similar. In my ESchrade plugin I use Zend_View to render some of my admin pages, though there is no reason why you couldn't use it elsewhere, as long as the plugin has already been loaded.

Adding the functionality is easy as long as the Zend Framework install is in your include path. He gives some sample code that creates the view object, defining the templates path and pulling in the "wp_register_sidebar_widget" WordPress method to import the view.

tagged: wordpress zendframework zendview plugin tutorial

Link:

Rob Allen's' Blog:
A Zend Framwork compound form element for dates
Mar 21, 2011 @ 17:23:08

In a new post to his blog today Rob Allen shows you how to create compound form element handling in a Zend Framework application thanks to some custom work with Zend_Form and Zend_View extensions.

A little bit of googling found this site http://codecaine.co.za/posts/compound-elements-with-zend-form which has not unfortunately disappeared, so the code in this article owes a lot of the author of that article. It turns out to be remarkably simple to create a single Zend Form element that is rendered as multiple form elements. We create an element object and a view helper object and we're done.

He shows how to create a custom form date helper that extends the base XHTML to create the isValid/getValue methods for handling the complex date input. There's also the code for the view that creates the custom date input and repopulates the content if there's a need.

tagged: zendframework complex date select zendform zendview

Link:

Chris Hartjes' Blog:
Fun with custom Zend_Views
Jun 25, 2010 @ 16:47:39

In a new post to his blog Chris Hartjes talks about some fund he had with custom Zend_Views in developing a fantasy gaming platform.

I managed to figure out that one requirement was for an admin to upload a header and footer file for a game. "The idea here is to be able to set up a new game for someone without programmer intervention". After I got over being insulted that a programmer was not required for every tiny tweak to the site (I'm kidding) I tried to figure out how I was going to accomplish this. I'm not a big fan of storing actual HTML content in a database.

He figured out that a set of custom Zend_View components were just what was needed - they could override the content that was out there and pull in the dynamic needs from database records. He includes both his test for the class (trying out TDD) and the code for the custom view. He also shares a few "gotcha" sort of things that he learned in the process.

tagged: zendview custom tutorial

Link:

ZendCasts.com:
Painless HTML Emails with Zend_Mail
Jun 23, 2010 @ 13:45:59

On the ZendCasts.com site today there's a new screencast posted looking at using the Zend_Mail component of the Zend Framework to easy (and painlessly) send HTML emails.

Here’s a quick video explaining how quickly and easy it is to write designer-friendly HTML emails using Zend_View and Zend_Mail.

You can watch the screencast via their in-page player and grab a copy of the project to follow along.

tagged: zendframework zendmail zendview screencast html tutorial

Link:

Daniel Cousineau's Blog:
Netbeans Code Completion and your Zend_View
May 12, 2010 @ 18:02:14

Daniel Cousineau has posted a quick tip for Netbeans users that are working with the Zend Framework. The tip involves code completion support in your Zend_View instances.

If you’re using Zend Framework and NetBeans, you may be like me and bemoaning the lack of code completion in your Zend Views. As you may know, essentially what Zend_View does is includes your view within a method that belongs to a Zend_View object. This gives your view some nice variable encapsulation as well as access to the $this object (which is how Zend_View provides access to all the ViewHelpers and other functions). Unfortunately NetBeans can’t figures this out (such is the problem with static analysis on a dynamic language) without help.

Thanks to a tip from another site he found out that all it takes is a phpDocumentor addition to the top of the script to tell Netbeans what the file is. It links the current object ($this) to tell the IDE that it's a Zend_View instance.

tagged: netbeas code completion zendframework zendview

Link:

Padraic Brady's Blog:
Zend Framework Book: Surviving The Deep End - Chapter 10 Released!
Sep 09, 2009 @ 15:42:21

Padraic Brady has released the latest chapter from his "Zend Framework: Surviving the Deep End" online book - chapter 10, a look at Zend_View, Zend_Layout, HTML5 and working with CSS in the YUI.

The new chapter explores setting up the example blog application's web design using Zend_View and Zend_Layout. I also spend some time exploring HTML 5, the future standards update for HTML. [...] The web design itself makes use of the Yahoo! User Interface Library's CSS components.

He's also posted the source code divided up by the different chapters. You can find out more about the book and read the contents so far on the book's website: Survivethedeepend.com.

tagged: zendframework book zendview zendlayout html5 yui

Link:

Zend Developer Zone:
Zend Framework 1.7.5 Released (Security Fix)
Feb 18, 2009 @ 14:48:14

As mentioned in this new post to the Zend Developer Zone, the latest version of the Zend Framework has been released - 1.7.5 - and includes an important security fix:

Besides the normal small enhancements and bug fixes that come with an incremental release such as this, there is also a rather important (and somewhat controversial) security fix that was added. This security fix breaks backwards compatibility with the previous version, because it simply must in order to exist. There is however a way to turn the security fix off to keep your current applications working in the case that this change breaks you.

Matthew Weier O'Phinny gives more detail on the issue over on his blog. The problem stems from an issue in the Zend_View's render() method and possible user input problems.

You can download this latest release from the Zend Framework website.

tagged: zendframework release security update fix zendview setscriptpath

Link:

Matthew Turland's Blog:
Output Filters in Zend_View
Jun 05, 2008 @ 16:16:02

Matthew Turland has written up a new tutorial explaining something that isn't "currently very well documented" in the Zend Framework - output filters.

They're mentioned in passing in the Zend_View documentation, but not reviewed in detail anywhere in the Reference Guide as of version 1.5.2. I was curious enough about how to implement markup minification that I decided to trace through the Zend_View source code in attempt to discern how output filters actually worked. As it turns out, it's actually pretty simple.

He explains a simple example of how they work, using a Zend_View object to build the filters on (addFilterPath/setFilterPath), and how he created his own output filter - the Minify filter. A minifier removes the comments and whitespace in the output to help reduce its size.

tagged: minify zendframework zendview output filter

Link:


Trending Topics: