Robert Basic has a new post showing how to style the default output of the Zend_Form component of the Zend Framework:
Here's an example for styling Zend_Form's default layout. The default layout is using definition lists. While there's an option for changing the default layout, the wrapper tags and stuff, I see no reason for it. Create the form, add some CSS and your good to go.
He includes some sample markup, the PHP (framework) code that produces it and the CSS that can be used to style it. This can then be used and expanded on however you'd want to customize the form to your site.
Gabi Solomon as a recent post to his blog about using the routing in the Zend Framework to add a multi-language component to your site.
Today i will continue the series of articles on the Zend Framework and i am going to talk about how i come to use the language component from Zend. The way i decided to go with it is by having a controller plugin that starts the language component and also detects the language.
He shows the creation of the bootstrap file to handle the different language requests in the URL and how to register the plugin for the application to use later on (GSD_Controller_Plugin_Language). The code for the plugin is included - it uses the Zend_Locale and Zend_Translate components to handle the translation between languages. This lets you push information out to the view and have the framework automatically translate it to the right language for you based on the URL.
Since the Zend Framework is mostly a library of components behind a framework structure, its parts can also be used individually if need be. In this new postMatt Stone shows how to combine the Zend_Acl component (for access control) with a CodeIgniter framework application.
In this post I will explain how to build simple access control functionality for your Code Igniter application using the Zend Framework ACL library. To follow this tutorial you will need a working installation of Code Igniter and a database. You will also need to download the Zend Framework.
He goes through the whole process - code and all - for pulling in and using the Zend_Acl library complete with a database (schema and inserts provided) as well as a sample controller for CodeIgniter to test things out.
In a recent post to his blog Sankho Mallik has posted a quick tutorial on using the Zend_Captcha component of the Zend Framework in your forms.
Zend Framework has a set of great classes included to take away a lot of the headaches involved with setting up a CAPTCHA system. The one I use is Zend_Captcha_Image, which creates an image for you and sets up a Session so you will be able to validate all information appropriately. Problem is, there's little documentation out there on this. [...] I'll show you everything you need to know to use Zend_Captcha_Image WITHOUT Zend_Form! If you'd like to learn the implementation using Zend_Form, please visit Robert Basic's Blog.
He follows the steps you'll need to get the component set up - checking for GD installation, making the CAPTCHA image folder - and includes some sample code in the form of a generateCaptcha and validateCaptcha methods to make it all work.
Jani Hartikainenlooks at a certain something that's missing from several PHP frameworks offered today - a good library for working with the M (Model) in MVC:
While ZF provides data access classes in the form of Zend_Db and related components, it doesn't provide any concrete examples of how you would implement a model class. This often confuses especially beginners. Providing a common base model, or an interface for implementing models, does have certain benefits, but it also has some problems...
He defines what a good model interface should be and do before looking at the good and the bad of implementing them. A good reason to have an interface is to have a common method the classes could use rather than just using a database wrapper class. On the downside, this can also be very limiting and require you to be locked in to how that interface works without the flexibility you might be used to with a looser framework.
Lorna Mitchell has posted an article to the Ibuildings blog looking at the Zend_Paginator component of the Zend Frameworks, some of her first impressions.
The idea of this module is to allow collections of data to be paginated. It takes the set, restricts the results, and can also generate the page numbers you need to move around between the resulting paginated data. Basically it saves me writing the same pagination code multiple times and then having to fix the bug where the last result on the previous page appears on the next ... all this has been thought of already.
She shows how it works with a simple example - paginating results from a database table, setting the count per page and the current page number. This object is pushed out to the view and rendered (in her case) via a Smarty template.
Sameer has posted an example of a new(ish) component of the Zend Framework - the Zend_Figlet component - and how you can use it to render the multi-line ASCII text figlet users are familiar with.
Zend_Text_Figlet is a Zend component which enables developers to create a FIGlet text. A Figlet is nothing but a technique of creating large letters using ordinary text. I don't know how to make a use of this in my daily matters, but its a nice recreation. A short history on Figlet can be found here. An example and the code to generate it is shown below.
He includes a few quick code examples to show it in action - including how to make it work with your own fonts and styles.
Almost a year ago, I proposed a really simple Zend Framework module, Zend_Log_Writer_Mail. [...] I've received a great deal of feedback, and have only recently committed myself to really pouring over that feedback to polish up the proposal. Thanks to everyone that commented!
So, as of tonight, I polished the code up, made what I felt to be the most worthwhile changes, and marked it as "Ready for Recommendation."
You can find out more about the component and leave your own thoughts via the proposal page on the Zend Framework site.
Andi Gutmans has posted an update on the status of the Zend_Amf component of the Zend Framework to his blog today, including links to some examples and updates from other developers.
Some of the resources he links to include several examples written up by Kevin Hoyt showing how to get started with the component, the webinar from Matthew Weier o'Phinney and Lee Brimlow as well as a manual page for it over on RIAFox.com.
Raphael Stolt has a new blog post today with a tutorial showing how to take the Zend_Dom_Query component out of the Zend Framework and use it to scrape content from another web site.
Today I stumbled upon an interesting and reportable scenario were I had to extract information of the weekly published Drum and Bass charts provided by BBC 1Xtra. As this information currently isn't available in any consumer friendly format like for example a RSS feed, I had to go that scraping route but didn't want to hustle with a regex approach. Since version 1.6.0 the Zend_Dom_Query component has been added to the framework mainly to support functional testing of MVC applications, but it also can be used for rolling custom website scrapers in a snap. Woot, perfect match!
He includes the code for his Bbc_DnbCharts_Scraper class he's created to show how the data is pulled in (via curl) and pushed into an object to be parsed.