<?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>Thu, 24 May 2012 19:00:04 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Seth May's Blog: The 5 Ws of Data Validation - Part 1]]></title>
      <guid>http://www.phpdeveloper.org/news/17871</guid>
      <link>http://www.phpdeveloper.org/news/17871</link>
      <description><![CDATA[<p>
With a reminder about the best practice of always validating your data, <i>Seth May</i> has <a href="http://blog.sethmay.net/2012/04/the-5-ws-of-data-validation/">this new post</a> about the "Five Ws" of validation - why, when, where and who.
</p>
<blockquote>
As web developers, the applications you write are complex data processing engines.  They try and convince your users to enter good, meaningful data and to respond in solid, predictable ways based on what was entered. Robust data validation will allow the rest of you application to work effectively. [...] Data is scrutinized in various ways to make sure that it adheres to basic restrictions and to fundamental properties.  It's no good receiving a sandwich when you expect a car.
</blockquote>
<p>The questions he answers are:</p>
<ul>
<li>Why is Data Validation Important?
<li>Where Should I be Validating Data?
<li>When Should My Data Be Validated?
<li>Who is Responsible for Validation?
<li>How Do I Validate My Data? (yes, there's a "w" in there!)
</ul>
<blockquote>
In the real world data is ugly, crazy, and untrustworthy. Your only hope to taming the data beast is to diligently, methodically validate your data.
</blockquote>]]></description>
      <pubDate>Thu, 26 Apr 2012 11:14:03 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Refulz Blog: Yii Framework - Scenarios for Conditional Multiple Validation Rules]]></title>
      <guid>http://www.phpdeveloper.org/news/17857</guid>
      <link>http://www.phpdeveloper.org/news/17857</link>
      <description><![CDATA[<p>
On the Refulz blog there's a post showing you how to <a href="http://php.refulz.com/yii-framework-scenarios-for-conditional-multiple-validation-rules/">set up conditional multiple validation rules</a> in a Yii framework application.
</p>
<blockquote>
I am yet to write the last article of the <a href="http://php.refulz.com/series/sessions-in-yii/">Yii Session</a> series. I just decided to write something about the scenarios in the Validation feature of Yii framework. Scenarios are a very useful tool for adding different validations rules for different cases on the same model. In a real life situation, you would require one validation rule for user registration but the same rule might not be applicable to the User login. Scenarios help you define validation rules for different situations within same model.
</blockquote>
<p>
He shows you how to set up a "rules()" method in your model and a few validation configurations inside it - ensuring the password and email are set, checking the length of the password, etc. Then, by calling the "validate()" method on the model, you can easily apply these rules and check the pass/fail status.
</p>]]></description>
      <pubDate>Tue, 24 Apr 2012 09:18:49 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Sebastian G&ouml;ttschkes' Blog: Testclasses for symfony2]]></title>
      <guid>http://www.phpdeveloper.org/news/17815</guid>
      <link>http://www.phpdeveloper.org/news/17815</link>
      <description><![CDATA[<p>
<i>Sebastian G&ouml;ttschkes</i> has <a href="http://sgoettschkes.blogspot.com/2012/04/testclasses-for-symfony2.html">a new post to his blog</a> about a set of abstract base testing classes he's developed to help with the functional, unit and validation testing of his Symfony2-based applications.
</p>
<blockquote>
So, when developing with symfony2, I rely on my tests. They are my safety net and without them, I get a little nervous after every change. Does everything work? Did I forget anything? So I developed some classes which I extend. They work on top of PHPUnit and the symfony2 WebTestCase. The classes are used by my different types of Tests: UnitTests, ValidationTests, FunctionalTests (as well as IntegrationTests).
</blockquote>
<p>
Code for each type of testing base class is included in the post showing how he extends the based PHPUnit test case for unit testing and the Symfony WebTestCase for validation and functional testing. Each one of the classes are ready to use and give you some handy helper methods too. 
</p>]]></description>
      <pubDate>Fri, 13 Apr 2012 11:57:53 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Form Validation with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17660</guid>
      <link>http://www.phpdeveloper.org/news/17660</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new tutorial showing how to <a href="http://phpmaster.com/form-validation-with-php/">do some form validation</a> using some basic PHP (no external libraries or tools here). This is a beginner level tutorial to help you get familiar with the concepts behind doing validation (and 
</p>
<blockquote>
In this article you'll construct and validate a simple form using HTML and PHP. The form is created using HTML and validation and processing of the form's contents is done with PHP. The goal is to teach you some basic HTML form elements and how their data is accessible to you in your PHP scripts.
</blockquote>
<p>
They start with the form itself, a basic setup with various kinds of fields - text, select, radio and a checkbox. Both the HTML markup and the PHP to do the validation is included. They check for things like "not empty", "must select one" and optional fields. Be sure to read <a href="http://phpmaster.com/form-validation-with-php/#comments">the comments</a> for some good tips on filtering the form's input too.
</p>]]></description>
      <pubDate>Mon, 12 Mar 2012 12:17:03 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Script-Tutorials.com: Form Validation with Javascript and PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17486</guid>
      <link>http://www.phpdeveloper.org/news/17486</link>
      <description><![CDATA[<p>
On the Script-Tutorials.com site today there's a <a href="http://www.script-tutorials.com/form-validation-with-javascript-and-php/">new tutorial about form validation</a> using a combination of jQuery on the frontend and PHP on the backend.
</p>
<blockquote>
In this tutorial, I will show you how to create an attractive, pleasant to look form for your website and then I will explain you how to dynamically validate them using Javascript. We'll also cover server-side validation with PHP to make everything 100% safe. This tutorial will help you to add more functionality to your forms which leads to better user experience and better quality of your website.
</blockquote>
<p>
His sample form (name, password, email and gender) is made from some pretty simple HTML markup. The real trick comes with the jQuery validation on each field handled in an onKeyUp. Included are both a "password strength" method and an email validation method to check the format of the address. Errored fields have their background color changed to indicate that they've failed and some basic validation (length, password match, etc.) are also included. The PHP does much of the same validation once the form is posted and returns any error messages that might have come up.
</p>
<p>
You can <a href="http://www.script-tutorials.com/demos/228/source.zip">download the code</a> or try out a <a href="http://www.script-tutorials.com/demos/228/index.php">live demo</a> to see the scripts together in action.
</p>]]></description>
      <pubDate>Thu, 02 Feb 2012 09:07:40 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: ClamAV as a Validation Filter in Zend Framework]]></title>
      <guid>http://www.phpdeveloper.org/news/17365</guid>
      <link>http://www.phpdeveloper.org/news/17365</link>
      <description><![CDATA[<p>
New on PHPMaster.com there's a tutorial showing you how to use <a href="http://www.clamav.net/lang/en/">ClamAV</a> support to <a href="http://phpmaster.com/zf-clamav/">work as a validation filter</a> in a Zend Framework application. ClamAV is an open source project that helps identify malicious threats like trojeans, viruses and malware.
</p>
<blockquote>
Ok, so you're pretty comfortable with using the Zend Framework, specifically the use of Forms. Along with that, you have a good working knowledge of how to combine a host of <a href="http://framework.zend.com/manual/en/zend.validate.html">standard validators</a> [...] but what do you do when a situation arises that's outside the scope of the pre-packaged validators and filters? Let's say you want to guard against users uploading files that contain viruses, for example. You would have to write a custom validator that checks the uploads aren't infected.
</blockquote>
<p>
You'll need to install the <a href="http://sourceforge.net/projects/php-clamav">ClamAV extension</a> on your loal machine for the feature to work. Once it's there, though, it's as simple as setting up the validator (based on Zend_Validate_Abstract) and calling the "cl_scanfile" method on the uploaded file. Also included is the code for a sample controller with a Zend_Form instance and an upload file field to help prove it's working.
</p>]]></description>
      <pubDate>Mon, 09 Jan 2012 12:20:48 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[WebInOne.net: Date validation for CodeIgniter 2]]></title>
      <guid>http://www.phpdeveloper.org/news/16966</guid>
      <link>http://www.phpdeveloper.org/news/16966</link>
      <description><![CDATA[<p>
On the WebInOne blog there's a post about doing some <a href="http://www.webinone.net/code-snippet/date-validation-for-codeigniter-2/">date validation in CodeIgniter 2</a> forms using the "set_validation" method.
</p>
<blockquote>
I wrote a tutorial <a href="http://www.webinone.net/tutorials/user-friendly-date-with-codeigniter-and-mysql/">here</a> about the CI date. At that post I used the HTML &lt;select> for the input of date. Sometime our client can want to use text box for the date input. We need the validation for this date. I have found this code from <a href="http://www.adcworks.com/blog/2009/04/code-igniter-date-validation/">here</a>. It is for CI 1.7.* and PHP 5.2.*. So I change some code for the CI 2.0.* and PHP 5.3.*.
</blockquote>
<p>
There's some code snippets included in the post showing how to use it in the form (HTML), setting the validation on the form object (for US and UK validation) and the actual code of the updated custom Validation class.
</p>]]></description>
      <pubDate>Fri, 07 Oct 2011 11:57:21 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Kevin Schroeder's Blog: Zend Framework 2 Event Manager]]></title>
      <guid>http://www.phpdeveloper.org/news/16869</guid>
      <link>http://www.phpdeveloper.org/news/16869</link>
      <description><![CDATA[<p>
<i>Kevin Schroeder</i> has a new post today sharing some of his <a href="http://www.eschrade.com/page/zend-framework-2-event-manager">experience with the Zend Framework 2 Event Manager</a> in a simple example of pre- and post-validation hooks in a model.
</p>
<blockquote>
I got to play with the Event Manager.  I did like the plugin functionality in ZF1, but it required some pretty static coding.  In some cases, like the front controller plugins, it makes more sense (though this way seems more desirable). [...] It's a ZF1 application, but since (it seems) the event manager is self-contained (and the autoloader works with both ZF1 and ZF2) you can simply paste it into your include_path and BOOM, you have an event manager.
</blockquote>
<p>
In his case he has a set of models extending a base class and wanted to introduce pre- and post-validation hooks to make it simpler to check the data he was working with. He includes the code for his base model class showing how he implemented the ZF2 EventManager in his ZF1 application. He attaches an event to the password class property and, on update, it automatically updates a temporary password value too.
</p>
<p>
You can get more information on using the EventManager in <a href="http://phpdeveloper.org/news/16850">this other post</a> from <i>Matthew Weier O'Phinney</a>.
</p>]]></description>
      <pubDate>Fri, 16 Sep 2011 11:40:47 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Rafael Dohms' Blog: Filtering objects using annotations]]></title>
      <guid>http://www.phpdeveloper.org/news/16710</guid>
      <link>http://www.phpdeveloper.org/news/16710</link>
      <description><![CDATA[<p>
<i>Rafael Dohms</i> has an interesting new post to his site today looking at a library he's developed (inspired by the Symfony Validation library) to help <a href="http://blog.rafaeldohms.com.br/2011/08/11/filtering-objects-using-annotations/">filtering values with rules defined in annotations</a>.
</p>
<blockquote>
PHP does not have native Annotations support, however many projects have been using doc blocks to add value and semantics to code, like PHPUnit, Doctrine and Symfony. The Doctrine did a really good job in making available a Annotation parser kit, which allows you to bring the power of annotations into you own project. This opens up a few possibilities.
</blockquote>
<p>
He shows the current use of the Validation library with a sample check of a $name variable for "not blank". <a href="https://github.com/rdohms/DMS">His tool, DMS,</a> extends this functionality and gives you access to both custom filtering methods and standard PHP functions to filter the resulting variable value. He includes an example showing two variables with filters StripTags, StripNewlines and Trim as well as the code to execute the filtering. You can get the library either ready to <a href="https://github.com/rdohms/DMS">integrate with Symfony/Doctrine</a> or as <a href="https://github.com/rdohms/DMS-Filter">a standalone tool</a>.
</p>]]></description>
      <pubDate>Fri, 12 Aug 2011 10:04:37 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Trevor Morris' Blog: fuelphp, forms and validation]]></title>
      <guid>http://www.phpdeveloper.org/news/16471</guid>
      <link>http://www.phpdeveloper.org/news/16471</link>
      <description><![CDATA[<p>
In <a href="http://www.trovster.com/blog/2011/03/fuelphp-forms-and-validation/">this post</a> to his blog <i>Trevor Morris</i> talks about his own introduction to the <a href="http://fuelphp.com/">Fuel</a> framework and some of his investigation into working with its forms support and validating the user input that comes from them.
</p>
<blockquote>
I have been working on developing a website with the newest PHP framework on the block - Fuel, which describes itself as "a simple, flexible, community driven PHP 5.3 web framework based on the best ideas of other frameworks with a fresh start". [...]  Although Fuel is a new framework, it borrows a lot of ideas from two very popular PHP frameworks, CodeIgniter and Kohana.
</blockquote>
<p>
He starts off with one concern, a lack of documentation around some things that made it difficult for him to work with the HTML form helpers. He includes an example code snippet to show a basic email form field generation. Behind the scenes, he shows how to use the Validation library to add rules on the fields and check for a pass/fail status on the fields.
</p>]]></description>
      <pubDate>Wed, 15 Jun 2011 09:57:28 -0500</pubDate>
    </item>
  </channel>
</rss>

