文件上传表单
@param $name 表单名称
@param $value 值
@param $attrArray html的属性 例如  class="x1"
@return unknown_type
492633
static function upload($name, $value = '', $attrArray = null)
    {
    	$attrStr = self::input_attr($attrArray);
    	$form = '';
        if(!empty($value))
            $form = " <a href='$value' target='_blank'>查看文件</a><br />\n重新上传";
        return $form."<input type='file' name='$name' id='{$name}' {$attrStr} />";
    }
762341
public function setInterfaceTrans($attr, $value = null)
    {
        if (is_array($attr))
            $this->interfaceTrans = array_merge($this->interfaceTrans, $attr);
        else
            $this->interfaceTrans[$attr] = $value;

        return $this;
    }
628685
public function set($name, $value = null): self
    {
        if (!is_array($name)) {
            $name = [$name => $value];
        }

        foreach ($name as $property => $value) {
            $this->_data[$property] = $value;
        }

        return $this;
    }
75111
public function text($name = null, $value = null, $attr = null)
    {
        return $this->createInput('text', $name, $value, $attr);
    }
163969
public function bind_value( string $name, $value, $data_type = false ) {
		$this->values_to_bind[ $name ] = array(
			'value'     => $value,
			'data_type' => $data_type,
		);
	}
775199
public function field(string $name, Syntax $value = null)
    {
        if ($value === null) {
            $names = explode('.', $name);
            $syntax = $this;
            foreach ($names as $field) {
                while (method_exists($syntax, 'syntax')) {
                    $syntax = $syntax->syntax();
                }
                if ($syntax instanceof ObjectSyntax && array_key_exists($field, $syntax->fields)) {
                    $syntax = $syntax->fields[$field];
                } else {
                    throw new \InvalidArgumentException("field '{$name}' not found");
                }
            }
            return $syntax;
        }

        $this->fields[$name] = $value;
        return $this;
    }
493193
static function textArea($name, $value, $attr = array())
    {
        $html = "<textarea ";

        $attr = array_merge(
            array(
                "name" => $name
            ),
            $attr
        );

        $html .= self::getAttributes($attr);
        $html .= ">" . $value . '</textarea>';

        echo $html;
    }
511080
public static function set($name, $value = null)
	{
		$names = parseCfgName($name);
		if (isset($names[0]))
		{
			$first = array_shift($names);
			$obj = self::getInstance($first);
			if ($obj)
			{
				return $obj->setVal($names, $value);
			}
			else
			{
				return false;
			}
		}
		else
		{
			return false;
		}
	}
244250
static function hidden($name, $value, $attr = array())
    {
        $attr = array_merge(
            array(
                "type" => "hidden"
            ),
            $attr
        );

        self::input($name, $value, $attr);
    }
531711
static function setArrayValue(&$data,$name=null,$val=null) {   
        if(!is_array($data) || $name === NULL || $val === NULL) return(false);
        
        if(is_array($name))
            $path = $name;
        else
            $path = explode(".", $name);

        if(sizeof($path) < 1) return false;
        
        $ptr=&$data; 
        for($i=0;$i < sizeof($path); $i++) {            
            $attr = $path[$i];
            if(!isset($ptr[$attr])) return false;
            $ptr = &$ptr[$attr];
        }
        
        // kraj
        $ptr = $val;
        return true;
    }
1064259
public function assign($name, $value = null)
    {
        if (is_string($name)) {
            return $this->data[$name] = $value;
        }

        if (is_array($name)) {
            return $this->assignFromArray($name);
        }

        throw new \InvalidArgumentException("Invalid data type for key, '" .gettype($name) . "' given.");
    }
12899
public function input($name, $value = '', $id = '', $class = '', array $attrs = array())
    {
        return '<input id="' . $id . '" class="' . $class . '" type="' . $this->_type . '" name="' . $name . '"
                          value="' . $value . '" ' . $this->buildAttrs($attrs) . '/>';
    }
799666
protected function _elementTpl($name, $value = '', $id = '', $text = '', array $attrs = array())
    {
        $alias    = Str::slug($value, true);
        $inpClass = $this->_jbSrt('val-' . $alias);
        $input    = $this->input($name, $value, $id, $inpClass, $attrs);

        if ($this->_tpl === 'default') {
            return $input . $this->label($id, $alias, $text);
        } elseif ($this->_tpl === 'wrap') {
            return $this->label($id, $alias, $input . ' ' . $text);
        }

        if (is_callable($this->_tpl)) {
            return call_user_func($this->_tpl, $this, $name, $value, $id, $text, $attrs);
        }

        return null;
    }
318504
private function recursiveDump(&$value, $name): void
  {
    switch (true)
    {
      case is_null($value):
        $this->dumpNull($value, $name);
        break;

      case is_bool($value):
        $this->dumpBool($value, $name);
        break;

      case is_float($value):
        $this->dumpFloat($value, $name);
        break;

      case is_int($value):
        $this->dumpInt($value, $name);
        break;

      case is_string($value):
        if (is_string($name) && stripos($name, 'password')!==false)
        {
          // Do not dump the value of a variable/key with a name tha contains 'password'.
          $tmp = str_repeat('*', 12);
          $this->dumpString($tmp, $name);
        }
        else
        {
          $this->dumpString($value, $name);
        }
        break;

      case is_object($value):
        $this->dumpObject($value, $name);
        break;

      case is_array($value):
        $this->dumpArray($value, $name);
        break;

      case is_resource($value):
        $this->dumpResource($value, $name);
        break;

      default:
        throw new FallenException('type', gettype($value));
    }
  }
139297
static function muti_select($name,$option,$default=array(),$self=null,$attrArray=null,$add_help=true)
	{
		$htmlStr = "<select name=\"$name\" id=\"$name\"";
		$htmlStr .= self::input_attr($attrArray) . ">\n";

		if($add_help)
		{
			if($add_help===true)
				$htmlStr .= "<option value=\"\">".self::$default_help_option."</option>\n";
			else $htmlStr .= "<option value=\"\">$add_help</option>\n";
		}
		foreach($option as $key => $value)
		{
			if($self) $key=$value;
			if (in_array($key,$default))
			{
				$htmlStr .= "<option value=\"{$key}\" selected=\"selected\">{$value}</option>\n";
			}
			else
			{
				$htmlStr .= "<option value=\"{$key}\">{$value}</option>\n";
			}
		}
		$htmlStr .= "</select>\n";

		return $htmlStr;
	}
849021
function text($name, $value, $attr)
    {
        $html = '';
        if (isset($attr['options'])) {
            if (!isset($attr['id'])) $attr['id'] = 'txt'.ucfirst($name);
            $html .= static::datalist($attr['id'].'_datalist', $attr['options']);
        }
        $attr['list'] = $attr['id'].'_datalist';
        $html .= $this->input($name, $value, $attr);
        return $html;

    }
84754
static function button($name,$value='',$attrArray=null)
	{
		if(empty($attrArray['type'])) $attrArray['type'] = 'button';
	    $attrStr = self::input_attr($attrArray);
		return "<input name='{$name}' id='{$name}' value='{$value}' {$attrStr} />";
	}