コード例 #1
0
ファイル: class-error.php プロジェクト: ntnvu/tcb_online
 public function ifempty($key, $message, $arr = null, $bind_key = null)
 {
     if (is_null($arr)) {
         $arr = $_POST;
     }
     if (is_null($bind_key)) {
         $bind_key = $key;
     }
     //		if (!isset($_POST[$key]) || $_POST[$key] === ""  || (is_array($_POST[$key]) && count($_POST[$key])==0)  ){
     $val_ex = arvlbSQA::val($key, $arr, false, false);
     if (empty($val_ex)) {
         $this->add($bind_key, $message);
         return true;
     }
     return false;
 }
コード例 #2
0
 /**
  * Fill in a generic option template, template to be supplied
  * @param string $template The template to be filled in 
  * @param string $name The name of the associated option
  * @param array $attr 
  * @param type $echo 
  * @return type
  */
 private function getGeneric($template, $name, $attr = null, $echo = true)
 {
     $value = arvlbSQA::val($name, $this->options, false, true);
     $attributes = is_array($attr) ? $this->attr_to_string($attr) : '';
     $html = sprintf($template, $name, $value, $attributes);
     if ($echo) {
         echo $html;
     }
     return $html;
 }