LogoPhly, boy, phly
the weblog and site of Matthew Weier O'Phinney

Monday, April 13. 2009

Creating composite elements

In my last post on decorators, I had an example that showed rendering a "date of birth" element:


<div class="element">
    <?php echo $form->dateOfBirth->renderLabel() ?>
    <?php echo $this->formText('dateOfBirth[day]', '', array(
        'size' => 2, 'maxlength' => 2)) ?>
    /
    <?php echo $this->formText('dateOfBirth[month]', '', array(
        'size' => 2, 'maxlength' => 2)) ?>
    /
    <?php echo $this->formText('dateOfBirth[year]', '', array(
        'size' => 4, 'maxlength' => 4)) ?>
</div>
 

This has prompted some questions about how this element might be represented as a Zend_Form_Element, as well as how a decorator might be written to encapsulate this logic. Fortunately, I'd already planned to tackle those very subjects for this post!


Continue reading "Creating composite elements"

Posted by Matthew Weier O'Phinney in PHP at 08:30 | Comments (20) | Trackbacks (0)
Defined tags for this entry: decorators, php, zend framework

Friday, April 10. 2009

Speaking at DPC (again!)

I'm thrilled to once again be speaking at the Dutch PHP Conference.

Like last year, I'm giving two sessions; unlike last year, these are going to be more advanced. I noticed last year both in terms of audience participation as well as in speaking with attendees that I'd be able to step it up a notch were I to return.


Continue reading "Speaking at DPC (again!)"

Posted by Matthew Weier O'Phinney in PHP at 00:25 | Comments (7) | Trackbacks (0)
Defined tags for this entry: conferences, dpc09, php, zend framework

Thursday, April 9. 2009

Rendering Zend_Form decorators individually

In the previous installment of this series on Zend_Form decorators, I looked at how you can combine decorators to create complex output. In that write-up, I noted that while you have a ton of flexibility with this approach, it also adds some complexity and overhead. In this article, I will show you how to render decorators individually in order to create custom markup for your form and/or individual elements.


Continue reading "Rendering Zend_Form decorators individually"

Posted by Matthew Weier O'Phinney in PHP at 09:28 | Comments (7) | Trackback (1)
Defined tags for this entry: decorators, php, zend framework

Tuesday, April 7. 2009

Zend Framework 1.8 PREVIEW Release

By the time you read this, the Zend Framework team will have released a preview release of 1.8.0. While the final release is scheduled for later this month, this release represents the hard work of many contributors and shows off a variety of powerful new components.

If you're a Zend Framework user, you should give the preview release a spin, to see what it can do:

  • 1.8 Preview Release (zip)
  • 1.8 Preview Release (tarball)

Continue reading "Zend Framework 1.8 PREVIEW Release"

Posted by Matthew Weier O'Phinney in PHP at 22:27 | Comments (50) | Trackback (1)
Defined tags for this entry: php, zend framework

Monday, April 6. 2009

From the inside-out: How to layer decorators

This marks the second in an on-going series on Zend_Form decorators.

You may have noticed in the previous installment that the decorator's render() method takes a single argument, $content. This is expected to be a string. render() will then take this string and decide to either replace it, append to it, or prepend it. This allows you to have a chain of decorators -- which allows you to create decorators that render only a subset of the element's metadata, and then layer these decorators to build the full markup for the element.

Let's look at how this works in practice.


Continue reading "From the inside-out: How to layer decorators"

Posted by Matthew Weier O'Phinney in PHP at 08:30 | Comments (19) | Trackbacks (0)
Defined tags for this entry: decorators, php, zend framework

Friday, April 3. 2009

The simplest Zend_Form decorator

I've been seeing ranting and general confusion about Zend_Form decorators (as well as the occasional praises), and thought I'd do a mini-series of blog posts showing how they work.


Continue reading "The simplest Zend_Form decorator"

Posted by Matthew Weier O'Phinney in PHP at 08:30 | Comments (37) | Trackback (1)
Defined tags for this entry: decorators, php, zend framework
(Page 1 of 1, totaling 6 entries)
  • Home
  • Resume
  • Blog
  • Phly PEAR Channel
  • Contact Me
  • About this site

ZCE

Zend Education Advisory Board Member

Add to Technorati Favorites

Calendar

Back April '09 Forward
Mon Tue Wed Thu Fri Sat Sun
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30      

Quicksearch

Links

  • PHLY - PHp LibrarY
  • Paul M. Jones
  • Mike Naberezny
  • Shahar Evron
  • Planet PHP
  • Zend Where I now work
  • Garden.org Where I once worked

Archives

March 2010
February 2010
January 2010
Recent...
Older...

Categories

XML Linux
XML Personal
XML Aikido
XML Family
XML Programming
XML Dojo
XML Perl
XML PHP

All categories

Syndicate This Blog

XML RSS 0.91 feed
XML RSS 1.0 feed
XML RSS 2.0 feed
ATOM/XML ATOM 0.3 feed
ATOM/XML ATOM 1.0 feed
XML RSS 2.0 Comments

Show tagged entries

xml best practices
xml books
xml conferences
xml cw09
xml decorators
xml dojo
xml dpc08
xml file_fortune
xml git
xml linux
xml mvc
xml oop
xml pear
xml perl
xml personal
xml php
xml phpworks08
xml programming
xml rest
xml ubuntu
xml vim
xml webinar
xml zendcon
xml zendcon08
xml zendcon09
xml zend framework
© 2004 - present, Matthew Weier O'Phinney
matthew-web <at> weierophinney.net