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

NetTuts.com:
Programming With Yii2: Specialized Validations
Jun 03, 2015 @ 15:53:23

NetTuts.com continues their series covering development with the Yii2 framework today with a new post looking at specialized validations (expanding on their previous post covering some of the basic built-in validations).

In this Programming With Yii2 series, I'm guiding readers in use of the newly upgraded Yii2 Framework for PHP. This tutorial is our second part, looking at Yii2's validators. Validators simplify the code needed to validate input, i.e. verify conformance or non-conformance of data input, typically from users via web forms. Specifically, we're going to explore some of the built-in specialty validations that are common to web development.

They cover some of the more complex validators in this tutorial including:

  • CaptchaValidator
  • ExistValidator
  • ImageValidator
  • RegularExpressionValidator
  • UniqueValidator
  • UrlValidator

They cover each of them with a brief summary of what they can do and a code example showing them in action. In some cases (like with the CAPTCHA validator) a screenshot is also included of the output.

tagged: yii2 series tutorial programming advanced validators

Link: http://code.tutsplus.com/tutorials/programming-with-yii2-specialized-validations--cms-23427

NetTuts.com:
Programming With Yii2: Validations
May 27, 2015 @ 16:41:37

NetTuts.com has continued their series around developing applications with the Yii2 framework with this new post covering validations.

In this Programming With Yii2 series, I'm guiding readers in use of the newly upgraded Yii2 Framework for PHP. In this tutorial, I'm going to introduce you to Yii2's validators. Validators simplify the code needed to validate input, i.e. verify conformance or non-conformance of data input, typically from users via web forms. For these examples, we'll continue to leverage the Hello application codebase we've used in past tutorials. Use the GitHub links on this page to get the code.

They start with a brief look at what the validators are and some common uses (and how they can save you time in the long run). There's a list of the current validators included in the framework and how/where they fall in the overall process flow. Then the tutorial gets into the application of a validator, showing how to define the rules, display errors associated with them and application to a "Sample" model and form. This includes the use of the FilterValidator, DefaultValueValidator and SafeValidator.

tagged: yii2 series tutorial programming validators

Link: http://code.tutsplus.com/tutorials/programming-with-yii2-validations--cms-23418


Trending Topics: