<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Sat, 25 May 2013 00:33:26 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[PHPMaster.com: Setting Custom Error Messages for Zend_Form_Element]]></title>
      <guid>http://www.phpdeveloper.org/news/18589</guid>
      <link>http://www.phpdeveloper.org/news/18589</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new post for all the Zend Framework (v1) users out there. In it, <i>Aurelio De Rosa</i> shows you how to <a href="http://phpmaster.com/setting-custom-error-messages-for-zend_form_element/">set custom error messages</a> for elements in a Zend_Form.
</p>
<blockquote>
In this article I'll show the solution to a common problem which arises when a developer has to create a non-English website or application that is based on the Zend Framework. How do we mark a field of a Zend_Form which is a Zend_Form_Element as invalid, showing one or more custom error messages? The problem is mainly caused by the native counter-intuitive methods of the Zend_Form_Element class which I'll explain in more details.
</blockquote>
<p>
He's included a basic example showing the creation of a form and the setup of a text element and some validators to match. He makes a controller and view to handle the output and submission then shows how to use "setErrors" (and "setErrorMessages") of the Zend_Form elements to setup that custom error. This only lets you set one message, though, regardless of the point of failure. To stop things when there's an error, you have to set the "breakChainOnFailure" parameter on the validator to false - then the message will make more sense.
</p>]]></description>
      <pubDate>Thu, 11 Oct 2012 08:58:37 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[TechPortal: Custom Zend Framework Form Elements]]></title>
      <guid>http://www.phpdeveloper.org/news/18300</guid>
      <link>http://www.phpdeveloper.org/news/18300</link>
      <description><![CDATA[<p>
In <a href="http://techportal.inviqa.com/2012/07/31/custom-zend-framework-form-elements/">this new post</a> to the TechPortal, <i>Gavin Corbett</i> introduces you to Zend_Form elements (a part of the Zend Framework, v1) and how to create a custom one.
</p>
<blockquote>
Creating forms in Zend Framework (ZF) is easy, but creating and managing complex forms can get messy! Using config files is perfectly good if you use standard Zend Form elements; it is quick and easy to setup a form in a few minutes however you will have limited control over how the form is rendered. If you want to display your own custom form element correctly in Zend Framework then some configuration is needed in order to achieve this with a config file. 
</blockquote>
<p>
He <a href="https://github.com/gavalar/TP-ZF1-CustomElements">includes an example</a> of first creating a basic form with a header and a single field element and validating the results of the submission. Building on that, he shows you how to create a custom "EmailAddress" form element and how to add in a view helper to style the output a bit.
</p>]]></description>
      <pubDate>Wed, 01 Aug 2012 08:28:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Lorna Mitchell's Blog: Fetching Namespaced XML Elements With SimpleXML]]></title>
      <guid>http://www.phpdeveloper.org/news/15383</guid>
      <link>http://www.phpdeveloper.org/news/15383</link>
      <description><![CDATA[<p>
<i>Lorna Mitchell</i> has a new post to her blog with a quick example of how to <a href="http://www.lornajane.net/posts/2010/Fetching-Namespaced-XML-Elements-With-SimpleXML">get namespaced values with SimpleXML</a> out of a properly formatted XML file.
</p>
<blockquote>
Recently I was working with some google APIs and needed to retrieve some namespaced elements from the result set. This confused me more than I expected it to so here's my code for the next time I need it (and if you use it too, then great!) I was reading from their <A href="http://code.google.com/apis/analytics/docs/gdata/gdataReferenceDataFeed.html">analytics data feed API</a>, this returns a few key fields and then multiple <entry> tags, each with namespaced children.
</blockquote>
<p>
The trick is to grab the current document's namespaces (via <a href="http://php.net/manual/de/simplexmlelement.getNamespaces.php">getNamespaces</a>), finding the key for the ones you want and grabbing them <a href="http://www.php.net/manual/de/simplexmlelement.children.php">as children</a>.
</p>]]></description>
      <pubDate>Thu, 04 Nov 2010 10:48:14 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Sameer Borate's Blog: Adding HTML5 'Canvas' element to Wordpress]]></title>
      <guid>http://www.phpdeveloper.org/news/14321</guid>
      <link>http://www.phpdeveloper.org/news/14321</link>
      <description><![CDATA[<p>
WordPress users that have been interested to explore some of what HTML5 has to offer should check out the latest post from <i>Sameer Borate</i>. He shows how to <a href="http://www.codediesel.com/wordpress/adding-html5-canvas-element-to-wordpress">embed a HTML5 Canvas element</a> you can use to make a "drawable" area of your page. You can test to see if your browser supports it by scrolling to the end of <a href="http://www.codediesel.com/wordpress/adding-html5-canvas-element-to-wordpress">the post</a>.
</p>
<blockquote>
Only if partially, but HTML 5 is slowly getting increased support from various browsers. Some of the HTML 5 features like '˜canvas' and '˜video' are supported by browsers like Firefox, Safari, Google Chrome and Opera. [...] The Canvas element consists of a drawable region defined in HTML on which you can dynamically draw graphics and animations using Javascript. The <a href="https://developer.mozilla.org/en/Canvas_tutorial">canvas API</a> provides a nice set of drawing functions to play with.
</blockquote>
<p>
His example detects to see if the browser has canvas support (using <a href="http://www.modernizr.com/">Modernizr</a>), creates a div container to hold the region and creates a Javascript to define the canvas as a 520 by 220 pixel box. The animation should be loaded automatically.
</p>]]></description>
      <pubDate>Thu, 08 Apr 2010 11:22:14 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[ZendCasts.com: Writing Composite Zend_Form Elements]]></title>
      <guid>http://www.phpdeveloper.org/news/14183</guid>
      <link>http://www.phpdeveloper.org/news/14183</link>
      <description><![CDATA[<p>
A recent tutorial (screencast) has been posted to the ZendCasts.com site looking at creating <a href="http://www.zendcasts.com/writing-composite-zend_form-elements/2010/03/">custom Zend_Form elements</a> when you need something more than just the usual, simple elements.
</p>
<blockquote>
This video should help you build your own composite Zend_Form element. We'll be building a phone element. The phone element will have 3 textboxes, one for geographic location, area code and local code. In the following videos will add a custom cell phone validator and some ajax validation. 
</blockquote>
<p>
You can grab a <a href="http://zendcasts.googlecode.com/svn/trunk/zc49-composite-form-elements/zc49-composite-form-elements.zip">copy of the source</a> if you'd like to follow along or you can just <a href="http://code.google.com/p/zendcasts/source/browse/#svn/trunk/zc49-composite-form-elements">look around the repository</a> to find the source for this and other great lessons from the site.
</p>]]></description>
      <pubDate>Mon, 15 Mar 2010 11:33:48 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Weier O'Phinney's Blog: Creating composite elements]]></title>
      <guid>http://www.phpdeveloper.org/news/12336</guid>
      <link>http://www.phpdeveloper.org/news/12336</link>
      <description><![CDATA[<p>
Based on an example in a previous blog post (seen <a href="http://weierophinney.net/matthew/archives/215-Rendering-Zend_Form-decorators-individually.html">here</a>) <i>Matthew Weier O'Phinney</i> wanted to <a href="http://weierophinney.net/matthew/archives/217-Creating-composite-elements.html">clear a few things up</a> on the "date of birth" element he had mocked up in his Zend_Form example.
</p>
<blockquote>
In my <a href="http://weierophinney.net/matthew/archives/215-Rendering-Zend_Form-decorators-individually.html">last post on decorators</a>, I had an example that showed rendering a "date of birth" element [...]. 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! 
</blockquote>
<p>
To be able to use the element in its current state the key lies in the setValue method. More correctly in the overriding of the setValue method. He includes an example class that is smart enough to use that custom form element. It has get and set methods for each of the date fields (month/day/year) and the set/getValue methods that can interact using them. He wraps this all up inside a form decorator and creates an instance of the Date element to help create and handle the properties it has.
</p>]]></description>
      <pubDate>Tue, 14 Apr 2009 10:25:53 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Jani Hartikainen's Blog: Complex custom elements in Zend_Form]]></title>
      <guid>http://www.phpdeveloper.org/news/11280</guid>
      <link>http://www.phpdeveloper.org/news/11280</link>
      <description><![CDATA[<p>
In <a href="http://codeutopia.net/blog/2008/10/23/complex-custom-elements-in-zend_form/">this new post</a> <i>Jani Hartikainen</i> shows a quick and easy method for creating a custom form element in your Zend Framework application. His example is a custom time element.
</p>
<blockquote>
The alternatives would be creating custom view helpers to output the custom form elements, and using the viewscript decorator. Creating a custom view helper would also require a custom form element class, and it would be a bit tricky. [...] I think the viewscript approach is the most flexible and simplest to implement, so I chose to go with that.
</blockquote>
<p>
His example defines a time field made up of three drop down lists, one each for hours, minutes and seconds. Included is the code to make the element (including a regular expression for validation) and the view script to display it.
</p>]]></description>
      <pubDate>Thu, 23 Oct 2008 12:09:55 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Neil Garb's Blog: Compound elements with Zend_Form]]></title>
      <guid>http://www.phpdeveloper.org/news/10628</guid>
      <link>http://www.phpdeveloper.org/news/10628</link>
      <description><![CDATA[<p>
In a <a href="http://codecaine.co.za/posts/compound-elements-with-zend-form">recent entry</a> to his blog, <i>Neil Garb</i> shows his method for creating compound elements in a Zend_Form object in your Zend Framework website.
</p>
<blockquote>
Zend_Form can save you a lot of time. It almost completely abstracts away the most boring and error-prone aspects of developing secure and standards-compliant HTML forms. But one thing it doesn't do out of the box is compound elements, such as three-field dates. In this post I'll show you the easiest way to do this ZF-style.
</blockquote>
<p>
He goes through the creation of the sample controller, an example of a custom element (the multiple date drop-downs he mentioned) and how to handle the validation in a "Zend Framework way" via an isValid call.
</p>]]></description>
      <pubDate>Thu, 17 Jul 2008 11:13:03 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Debuggable Blog: Make your life easier with these five CakePHP Quicktips]]></title>
      <guid>http://www.phpdeveloper.org/news/10301</guid>
      <link>http://www.phpdeveloper.org/news/10301</link>
      <description><![CDATA[<p>
<i>Tim Koschutzki</i> has <a href="http://www.debuggable.com/posts/make-your-life-easier-with-these-five-cakephp-quicktips:48170ee5-0cc0-4815-af60-7c264834cda3">five quick tips</a> for the CakePHP users out there to help make your lives just a bit easier:
</p>
<ul>
<li>The prd() convenience function
<li>How to debug your CakePHP emails?
<li>Use elements where possible and make them belong to the controller
<li>Combine your h1 titles with Cake's page title
<li>Avoid long parameter lists
</ul>
<p>
Each <a href="http://www.debuggable.com/posts/make-your-life-easier-with-these-five-cakephp-quicktips:48170ee5-0cc0-4815-af60-7c264834cda3">tip</a> comes complete with code and a brief explanation of its use.
</p>]]></description>
      <pubDate>Thu, 29 May 2008 15:23:48 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[MSBWare.com: XML to Array]]></title>
      <guid>http://www.phpdeveloper.org/news/9967</guid>
      <link>http://www.phpdeveloper.org/news/9967</link>
      <description><![CDATA[<p>
<i>Michael</i> has posted <a href="http://www.msbware.com/articles/scripts/xml_to_array.html">a simple script</a> today that takes in XML data and spits back out an array on the other side:
</p>
<blockquote>
The function takes the specified XML data (which must be in valid XML format) and converts into an array.  Any attributes in the XML elements are dropped an only the element values are placed in the array.
</blockquote>
<p>
<a href="http://www.msbware.com/articles/scripts/xml_to_array.html">The code</a> uses a combination of XPath, DOM, and regular expressions to parse the given XML content.
</p>]]></description>
      <pubDate>Mon, 14 Apr 2008 10:23:11 -0500</pubDate>
    </item>
  </channel>
</rss>
