예제 #1
0
 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;
 }
예제 #2
0
 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;
 }
예제 #3
0
파일: app.class.php 프로젝트: kurari/NyaaFW
 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;
 }