public function validateInput() { $v = Validator::load(); $v->checkPost($_POST, array('label' => array('required' => true, 'min' => 1, 'max' => 254), 'name' => array('required' => true, 'min' => 1, 'max' => 254))); if (!$v->passed()) { foreach ($v->errors() as $error) { $_SESSION['ERRORS'][] = $error; } Redirect::to(Input::get('current_url')); exit; } }
public function validateInput() { $validate = Validator::load(DB::load()); $validation = $validate->checkPost($_POST, array('username' => array('required' => true, 'min' => 3, 'max' => 32, 'notTaken' => 'Users'), 'full_name' => array('required' => true, 'min' => 3, 'max' => 50), 'org' => array('required' => false, 'max' => 32), 'password' => array('required' => true, 'min' => 3, 'max' => 64, 'ValidPass' => Input::get('password')), 'email' => array('required' => true, 'min' => 3, 'max' => 32, 'validEmail' => Input::get('email')))); if (!$v->passed()) { foreach ($v->errors() as $error) { Session::addKey('WARNINGS', $error, $error); } Redirect::to(Input::get('current')); exit; } }
public function validateInput() { $v = Validator::load(); $v->checkPost($_POST, array('editor' => array('required' => true, 'min' => 1))); if (!$v->passed()) { // Session::set($title, Input::get($title)); foreach ($v->errors() as $error) { $_SESSION['ERRORS'][] = $error; } Redirect::to(Input::get('current_url')); exit; } }
public function validateFile() { $v = Validator::load(); $v->checkFile($_FILES, array('files' => array('ext' => array('png', 'jpg', 'jpeg'), 'size' => 3000000))); if (!$v->passed()) { foreach ($v->errors() as $error) { $_SESSION['ERRORS'][] = $error; } var_dump($v->errors()); Redirect::to($this->data['current_url']); exit; } }