Skip to content

Instantly share code, notes, and snippets.

@lantins
Created September 5, 2008 04:15
Show Gist options
  • Save lantins/8921 to your computer and use it in GitHub Desktop.
Save lantins/8921 to your computer and use it in GitHub Desktop.
<?php
// filtering
$data = array();
$data['name'] = itsy_filter::text($this->_request->post('name'));
$data['age'] = itsy_filter::digit($this->_request->post('age'));
$data['address_line_1'] = itsy_filter::text($this->_request->post('address_line_1'));
$data->name = itsy_filter::text($this->_request->post('name'));
$data->age = itsy_filter::digit($this->_request->post('age'));
$data->address_line_1 = itsy_filter::text($this->_request->post('address_line_1'));
// validation
$test_form = new itsy_validate($data);
$test_form->name->text();
$test_form->age->digit();
$test_form->address_line_1->text();
$test_form = new itsy_validate($data);
$test_form['name']->text();
$test_form['age']->digit();
$test_form['address_line_1']->text();
$test_form = new itsy_validate($data);
$test_form->add('name')
->required()
->text();
$test_form->add('age')
->digit();
$test_form->add('address_line_1')
->default('1 ellerbeck barns')
->text();
$test_form = array();
$test_form['name'] = itsy_validate::text($data['name']);
$test_form['age'] = itsy_validate::digit($data['age']);
$test_form['address_line_1'] = itsy_validate::text($data['address_line_1']);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment