function getValidater($Req) { require_once 'validater/validate.class.php'; require_once 'validater/validater.class.php'; // Build validaters $validater = new NyaaValidater(); $notnull = NyaaValidate::factory(array('type' => 'notnull', 'target' => array('email'), 'message' => '%fieldは必須です', 'con' => 'と')); // If To Login Required Password is not null if ($Req->isEmpty('toRegist')) { $notnull->addTarget('password'); $login = NyaaValidate::factory(array('type' => 'custom', 'message' => 'ログイン情報に誤りがあります', 'func' => array($this, 'validateLogin'), 'target' => array('email', 'password'))); $validater->addValidate($login); } $validater->addValidate($notnull); return $validater; }
function getValidater() { require_once 'validater/validate.class.php'; require_once 'validater/validater.class.php'; // Build validaters $validater = new NyaaValidater(); $notnull = NyaaValidate::factory(array('type' => 'notnull', 'target' => array('familyName', 'firstName', 'email', 'password'), 'message' => '%fieldは必須です', 'con' => 'と')); $validater->addValidate($notnull); return $validater; }
function validaterFactory($conf) { require_once 'validater/validate.class.php'; require_once 'validater/validater.class.php'; $conf = NyaaConf::load($conf); $validater = new NyaaValidater(); foreach ($conf->get() as $k => $v) { $validate = NyaaValidate::factory(array('type' => $v['type'], 'target' => $v['target'], 'message' => $v['message'], 'con' => $v['message_sep'])); $validater->addValidate($validate); } return $validater; }