多行文本输入框
@param $name
@param $value
@param $attrArray
@return string
8494
static function text($name,$value='',$attrArray=null)
	{
		if(!isset($attrArray['cols'])) $attrArray['cols'] = 60;
		if(!isset($attrArray['rows'])) $attrArray['rows'] = 3;
		$attrStr = self::input_attr($attrArray);
		$forms = "<textarea name='{$name}' id='{$name}' $attrStr>$value</textarea>";
		return $forms;
	}
429889
public static function text($name, $value, array $attributes = array())
    {
        $node = new Node\Text();

        if (!is_null($name)) {
            $attributes['name'] = $name;
        }

        if (!is_null($value)) {
            $attributes['value'] = $value;
        }

        return $node->render($attributes);
    }
1253091
private static function getHtmlAttribute(string $name, $value): string
    {
        if (!self::isset($value)) {
            return '';
        }

        if ($value === true) {
            return $name;
        }

        if (is_array($value)) {
            $value = self::convertAttributeArrayValue($name, $value);
        }

        return sprintf('%s="%s"', $name, static::escape((string) $value));
    }
539728
protected function renderItem($name, $value)
    {
        if (is_array($value))
        {
            $lines = $this->renderArrayItem($name, $value);
        }
        else
        {
            $lines = $this->renderStringItem($name, $value);
        }

        return $lines;
    }
355307
public static function get( $name = '', $value = '' ) {

		if ( ! empty( $value ) ) {
			$_GET[ $name ] = $value;
		}

		if ( empty( $name ) ) {
			return $_GET;
		} else {
			return ( isset( $_GET[ $name ] ) ) ? $_GET[ $name ] : NULL;
		}

	}
40249
public function headerLine($name, $value)
    {
        if (stripos($name, 'X-') !== false) {
            return null;
        }

        return parent::headerLine($name, $value);
    }
80704
private function ValidateAddress($Name, $Value, $MinLength = 1, $MaxLength = 1, $AllowEmpty = false)
        {
            if (empty($Value)) {
                // 是否允許空值
                $this->IsAllowEmpty($Name, $AllowEmpty);
            } else {
                // 長度檢查

                if ($MinLength) {
                    // 最小長度限制
                    $this->IsBelowLength($Name, $this->StringLength($Value, $this->Encode), $MinLength);
                }

                if ($MaxLength) {
                    // 最大長度限制
                    $this->IsOverLength($Name, $this->StringLength($Value, $this->Encode), $MaxLength);
                }
            }
        }
702480
static function text($name, $value, $attr = array())
    {
        $attr = array_merge(
            array(
                "type" => "text"
            ),
            $attr
        );

        self::input($name, $value, $attr);
    }
1319847
protected function handleJsonType($name, $value)
    {
        if ($cast = array_get($this->repository->getCasts(), $name)) {
            if (in_array($cast, ['array', 'json'], true)) {
                $value = json_decode($value);
            }
        }

        return $value;
    }
89659
public function formTinymce($name, $value = null, $attribs = null)
    {
        $this->view->headScript()->prependFile(self::$tinyMcePath);

        $xhtml = '
            <script type="text/javascript">
                tinyMCE.init({

                    // General options
                    mode : "exact",
                    theme : "advanced",
                    language: "' . $this->locale->getLanguage() . '", 
                    culture:"' . $this->locale->getLanguage() . '",
                    elements: "' . $name . '",

                    setup: function(ed) {
                        ed.onClick.add(function(ed, evt) {
                            $("span#' . $name . '_parent").addClass("' . self::FOCUS_CLASS . '");
                        });
                    },

                    init_instance_callback: function(instance) {

                        var inEditor = false;;

                        $("tr.mceFirst").click(function() {
                            $("span#' . $name . '_parent").addClass("' . self::FOCUS_CLASS . '");
                            inEditor = true;
                        });

                        $("tr.mceLast").click(function() {
                            $("span#' . $name . '_parent").addClass("' . self::FOCUS_CLASS . '");
                            inEditor = true;
                        });

                        $("body").click(function() {
                            if (!inEditor) {
                                $("span#' . $name . '_parent").removeClass("' . self::FOCUS_CLASS . '");
                            } else {
                                inEditor = false;
                            }
                        });		
                    },

                    plugins: "safari,advlist,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

                    theme_advanced_buttons1: "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
                    theme_advanced_buttons2: "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,|,forecolor,backcolor,styleprops,|,fullscreen",
                    theme_advanced_buttons3: "tablecontrols,|,hr,removeformat,visualaid,|,charmap,emotions,media,advhr,|,print,|,sub,sup",
                    theme_advanced_buttons4: "insertlayer,moveforward,movebackward,absolute,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage,insertdate,inserttime,preview,|,anchor,image,cleanup,code,spellchecker",

                    theme_advanced_toolbar_location: "top",
                    theme_advanced_toolbar_align: "left",
                    theme_advanced_statusbar_location: "bottom",
                    theme_advanced_resizing: false,
                    extended_valid_elements: "hr[id|title|alt|class|width|size|noshade],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],a[class|name|href|target|title|onclick|rel]",
                    relative_urls: false,
                    remove_script_host: false,
                    debug: false,
                    entity_encoding: "raw",
                    file_browser_callback: "openKCFinder"
                });
                
                function openKCFinder(field_name, url, type, win) {
                    tinyMCE.activeEditor.windowManager.open({
                    file: "' . Kcfinder::$kcfinderPath . '?opener=tinymce&lang=' . $this->locale->getLanguage() . '&type=' . '" + type,
                    title: "' . $this->view->translate('Zarządzanie plikami') . ' " + type,
                    width: 780,
                    height: 500,
                    resizable: "yes",
                    inline: true,
                    close_previous: "yes",
                    popup_css: true
                }, {
                    window: win,
                    input: field_name
                });

                return false;
            }
            </script>';

        $xhtml .= $this->formTextarea($name, $value, $attribs);

        return $xhtml;
    }
485375
public static function text($name, $value = '', array $htmlOptions = [])
    {
    	return self::input('text', $name, $value) . self::htmlOptions($htmlOptions) .'>';
    }
1255393
public function frm($txt, $att = '', $a = '', $m = '', $e = '')
    {
        $attList = array();
        if (!empty($a)) {
            $attList['action'] = $a;
        }
        if (!empty($m)) {
            $attList['method'] = $m;
        }
        if (!empty($e)) {
            $attList['enctype'] = $e;
        }
        $newatt = $this->addAttributes($attList, $att);

        return $this->tag('form', $txt, $newatt);
    }
476466
protected function composeLine($name, $value, $export = false)
    {
        return sprintf('%s%s="%s"', ($export ? 'export ' : ''), $name, addcslashes($value, '"\\'));
    }
226683
public function inputFormat($value, $name)
    {
        if (!Utils::isHex($value)) {
            throw new InvalidArgumentException('The value to inputFormat must be hex bytes.');
        }
        $value = Utils::stripZero($value);

        if (mb_strlen($value) % 2 !== 0) {
            $value = "0" . $value;
            // throw new InvalidArgumentException('The value to inputFormat has invalid length. Value: ' . $value);
        }

        if (mb_strlen($value) > 64) {
            throw new InvalidArgumentException('The value to inputFormat is too long.');
        }
        $l = floor((mb_strlen($value) + 63) / 64);
        $padding = (($l * 64 - mb_strlen($value) + 1) >= 0) ? $l * 64 - mb_strlen($value) : 0;

        return $value . implode('', array_fill(0, $padding, '0'));
    }
729902
private function ValidateURL($Name, $Value, $MaxLength = 200, $AllowEmpty = false)
        {
            if (empty($Value)) {
                // 是否允許空值
                $this->IsAllowEmpty($Name, $AllowEmpty);
            } else {
                // 格式檢查
                $this->IsValidFormat($Name, '/^(http|https):\/\/+/', $Value);

                // 長度檢查
                $this->IsOverLength($Name, $this->StringLength($Value, $this->Encode), $MaxLength);
            }
        }
39912
public static function __($text,$arr = array(),$language='',$file=''){
		if(!$file){
			$file = 'companie';
		}
		if(!$language){
			$language = self::getCurrentLanguage();
		}
		Yii::$app->language = $language;
		$gText = Yii::t($file, $text);
		if(!empty($arr)){
			foreach($arr as $a){
				$gText = preg_replace('/%s/',$a,$gText,1);
			}
		}
		return $gText;
		
	}
1203786
private function dumpString(string &$value, $name): void
  {
    if ($this->scalarReferences)
    {
      list($id, $ref) = $this->isReference($value);
    }
    else
    {
      $id  = null;
      $ref = null;
    }

    $this->writer->writeString($id, $ref, $value, $name);
  }