Forms Validation with CakePHP

557 days ago
tags: ,

Neglecting to validate user input is akin to foregoing any defensive gameplan for containing the NFL’s leading rusher. Chances are sooner or later you’re going to get run over. Yet even in spite of the dire ramifications of doing otherwise, many developers choose to ignore the potential problems presented by user input, reasoning that data validation is tedious and distracts them from the larger goal of building a working application. The result? Corrupt and incorrect data, cross-site scripting and SQL injection attacks, and a giant headache come Monday morning.

There really is no way around it anymore: you must validate user input within every web application. However, because data validation is a task faced by all developers, and it follows a fairly rigorous specification regardless of where its ultimately applied, the task seems suitable for automation by a framework. CakePHP does exactly this, going a long way towards making data validation a snap.

In the second installment of this occasional Developer.com series on this powerful framework, I’d like to show you another way frameworks can make your life easier by demonstrating CakePHP’s data validation capabilities.

Read the article



Scaffolding with CakePHP

585 days ago
tags:

Web frameworks are all the rage these days, and for good reason – they save developers a tremendous amount of time and trouble. After all, what developer wouldn’t opt to focus on being creative and making effective use of his skills rather than being burdened with the development of yet another data management interface or building another home-grown templating system? Frameworks remove such repetition by taking care of many of these tedious tasks for you.

One such source of repetition is setting up the creation, retrieval, modification, and deletion interfaces. In this tutorial, I show you how use CakePHP to automate the creation of these interfaces:

Read the tutorial