表单头部
@param $form_name
@param $method
@param $action
@param $if_upload
@param $attrArray
@return string
188363
static function head($form_name,$method='post',$action='',$if_upload=false,$attrArray=null)
	{
	    if($if_upload) $attrArray['enctype'] = "multipart/form-data";
	    $attrStr = self::input_attr($attrArray);
	    return "action='$action' method='$method' name='$form_name' id='$form_name' $attrStr";
	}
1158443
function hasUpload($name) {
		// if information about the specified file upload is available
		if (isset($_FILES[$name])) {
			// if the file input had an array-style name
			if (\is_array($_FILES[$name]['error'])) {
				// for any file selected from this input
				foreach ($_FILES[$name]['error'] as $errorCode) {
					if ($errorCode !== \UPLOAD_ERR_NO_FILE) {
						return true;
					}
				}
			}
			// if the file input had a scalar-style name
			else {
				return $_FILES[$name]['error'] !== \UPLOAD_ERR_NO_FILE;
			}
		}

		return false;
	}
442955
static public function help($name, $form_type='button', $align='')
    {
        $text  = Help::get($name);
        
        $value = '';
        if ($text) {
            $align = $align == 'left' ? 'pull-left' : ($align == 'right' ? 'pull-right' : '');
            switch ($form_type) {
                case 'button':
                case 'btn':
                    $value = '<a class="btn btn-white open-help '.$align.'" data-name="'.$name.'" title="帮助"><i class="fa fa-question-circle"></i> 帮助</a>';
                    break;
                case 'icon';
                    $value = '<i class="fa fa-2x fa-question-circle open-help '.$align.'" data-name="'.$name.'" style="cursor:pointer;"></i>';
                default:
            }
            
            $value .= '<div style="display:none;" data-name="'.$name.'">'.$text.'</div>';
            $value .= <<<EOF
            <script>require(["util"], function (){
                $(".open-help").click(function () {
                    var name = $(this).attr("data-name");
                    var content = $("div[data-name=${name}]").html();
                    util.dialog.show({
                        title:   "操作帮助",
                        content: content,
                        height: 90,
                        width:  500
                    });
                });
            });</script>
EOF;
            
        }
        
        return $value;
    }
597054
public function getJsValidatorString($formName = null, $onLoad = true)
    {
        $onLoad = $onLoad ? 'true' : 'false';
        $this->siftQueue();

        $models = array();
        // Process just the specified form
        if ($formName) {
            if (!isset($this->queue[$formName])) {
                $list = implode(', ', array_keys($this->queue));
                throw new UndefinedFormException("Form '$formName' was not found. Existing forms: $list");
            }
            $models[] = $this->createJsModel($this->queue[$formName]);
            unset($this->queue[$formName]);
        } else { // Or process whole queue
            $models = $this->processQueue();
        }
        // If there are no forms to validate
        if (!array_filter($models)) {
            return '';
        }

        $result = array();
        foreach ($models as $model) {
            $result[] = "FpJsFormValidator.addModel({$model}, {$onLoad});";
        }

        return implode("\n", $result);
    }
1126636
public function submitStepA(array $form, FormStateInterface $form_state)
    {
        $formData = &$form_state->getStorage();
        $values   = &$form_state->getValues();

        /** @var $site Site */
        $site                 = $formData['site'];
        $site->title          = $values['title'];
        $site->title_admin    = $values['title_admin'];
        $site->http_host      = $values['http_host'];
        $site->allowed_protocols = $values['allowed_protocols'];
        $site->http_redirects = $values['http_redirects'];
        $site->replacement_of = $values['replacement_of'];
        $site->is_public      = $values['is_public'];

        $formData['step'] = 'b';
        $form_state->setRebuild(true);
    }
962315
protected function processMethodParams(array $method, string $file, string $name)
    {
        if (!empty($method['docblock']['inheritdoc'])) {
            return;
        }

        foreach ($method['params'] as $param => $type) {
            if (is_array($type)) {
                $type = implode('|', $type);
            }

            if (!isset($method['docblock']['params'][$param])) {
                $this->warnings[] = [
                    'type' => 'param-missing',
                    'file' => $file,
                    'class' => $name,
                    'method' => $name,
                    'line' => $method['line'],
                    'param' => $param,
                ];

                return;
            }

            if (empty($type)) {
                return;
            }

            $paramType = $method['docblock']['params'][$param];
            if ($paramType !== $type) {
                if (!($type == 'array' && substr($paramType, -2) == '[]')) {
                    $this->warnings[] = [
                        'type' => 'param-mismatch',
                        'file' => $file,
                        'class' => $name,
                        'method' => $name,
                        'line' => $method['line'],
                        'param' => $param,
                        'param-type' => $type,
                        'doc-type' => $method['docblock']['params'][$param],
                    ];
                }
            }
        }
    }
1276718
public static function beginFormTb(
        $layout = self::FORM_LAYOUT_VERTICAL,
        $action = '',
        $method = 'post',
        $htmlOptions = array()
    ) {
        if (!empty($layout)) {
            self::addCssClass('form-' . $layout, $htmlOptions);
        }
        return parent::beginForm($action, $method, $htmlOptions);
    }
975584
public function HTML_QuickForm($formName='', $method='post', $action='', $target='', $attributes=null, $trackSubmit = false) {
        debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
        self::__construct($formName, $method, $action, $target, $attributes, $trackSubmit);
    }
25384
protected function initialization($controller_name, $method_name)
    {
        if ($this->isRPC && !empty($this->rpc_request_id)) {
            //全链路监控保证调用的request_id唯一
            $this->context['request_id'] = $this->rpc_request_id;
        } else {
            $this->context['request_id'] = time() . crc32($controller_name . $method_name . getTickTime() . rand(1, 10000000));
        }
        $this->context['controller_name'] = $controller_name;
        $this->context['method_name'] = "$controller_name::$method_name";
        $this->context['ip'] = $this->getFdInfo()['remote_ip'];
        if (!empty($this->uid)) {
            $this->context['uid'] = $this->uid;
        }
        $this->db = $this->loader->mysql("mysqlPool",$this);
        $this->redis = $this->loader->redis("redisPool",$this);
        if ($this->isEnableError) {
            $this->Error = $this->loader->model(Error::class, $this);
        }
    }
497634
function tpl_key_import_form($attrib)
    {
        $attrib += array('id' => 'rcmKeyImportForm');

        $upload = new html_inputfield(array('type' => 'file', 'name' => '_file',
            'id' => 'rcmimportfile', 'size' => 30));
        $search = new html_inputfield(array('type' => 'text', 'name' => '_search',
            'id' => 'rcmimportsearch', 'size' => 30));

        $upload_button = new html_inputfield(array(
                'type'    => 'button',
                'value'   => $this->rc->gettext('import'),
                'class'   => 'button',
                'onclick' => "return rcmail.command('plugin.enigma-import','',this,event)",
        ));

        $search_button = new html_inputfield(array(
                'type'    => 'button',
                'value'   => $this->rc->gettext('search'),
                'class'   => 'button',
                'onclick' => "return rcmail.command('plugin.enigma-import-search','',this,event)",
        ));

        $upload_form = html::div(null,
            rcube::Q($this->enigma->gettext('keyimporttext'), 'show')
            . html::br() . html::br() . $upload->show()
            . html::br() . html::br() . $upload_button->show()
        );

        $search_form = html::div(null,
            rcube::Q($this->enigma->gettext('keyimportsearchtext'), 'show')
            . html::br() . html::br() . $search->show()
            . html::br() . html::br() . $search_button->show()
        );

        $form = html::tag('fieldset', '', html::tag('legend', null, $this->enigma->gettext('keyimportlabel')) . $upload_form)
            . html::tag('fieldset', '', html::tag('legend', null, $this->enigma->gettext('keyimportsearchlabel')) . $search_form);

        $this->rc->output->add_label('selectimportfile', 'importwait', 'nopubkeyfor', 'nopubkeyforsender',
            'encryptnoattachments','encryptedsendialog','searchpubkeyservers', 'importpubkeys',
            'encryptpubkeysfound',  'search', 'close', 'import', 'keyid', 'keylength', 'keyexpired',
            'keyrevoked', 'keyimportsuccess', 'keyservererror');
        $this->rc->output->add_gui_object('importform', $attrib['id']);
        $this->rc->output->include_script('publickey.js');

        $out = $this->rc->output->form_tag(array(
            'action'  => $this->rc->url(array('action' => $this->rc->action, 'a' => 'import')),
            'method'  => 'post',
            'enctype' => 'multipart/form-data') + $attrib,
            $form
        );

        return $out;
    }
1027893
private function getKey(string $action, string $method, string $separator = '_')
    {
        //setSomeSample -> post/Some/Sample
        $key = preg_replace('/([A-Z0-9])/', $separator."$1", $method);
        //set/Some/Sample -> /some/sample
        return trim(strtolower(substr($key, strlen($action))), $separator);
    }
1171496
protected function getUploadFileMethod(array $fields, $withFormRequest = false)
    {
        if (!$withFormRequest && Config::createMoveFileMethod() && $this->containsfile($fields)) {
            $stubName = 'controller-upload-method';
            if (Helpers::isNewerThanOrEqualTo()) {
                $stubName .= '-5.3';
            }

            return $this->getStubContent($stubName, $this->getTemplateName());
        }

        return '';
    }
1104293
function action_post($trim = false)
    {
        if ($_POST)
        {
            $this->proc_upfiles();
            if ($trim)
            {
                $this->trim_post();
            }
            if ($this->post_callback)
            {
                call_user_func($this->post_callback, $this);
            }

            if (isset($this->gets['select']))
            {
                $this->filter_field();
            }
            if (isset($_GET['id']))
            {
                if ($this->gets['set_disable'])
                {
                    return false;
                }
                if ($this->set_callback)
                {
                    call_user_func($this->set_callback, $this);
                }
                $this->model->set((int)$_GET['id'], $_POST);
            }
            else
            {
                if ($this->gets['add_disable'])
                {
                    return false;
                }
                if ($this->add_callback)
                {
                    call_user_func($this->add_callback, $this);
                }
                $this->model->put($_POST);
            }

            return true;
        }
        else
        {
            return false;
        }
    }
424760
public static function open($name = NULL,
                         $class = NULL,
                         $id = NULL,
                         $method = 'POST',
                         $action = '',
                         $attrs = array()
                         )
    {
        $tag = NULL;
        
        if($class)
            $attrs['class'] = $class;
        if($id)
            $attrs['id'] = $id;
        $attrs['method'] = $method;
        $attrs['action'] = $action;
        
        $tag .= '<form';
        $tag .= ' ' . self::parseAttrs($attrs);
        $tag .= '>';
        return $tag;
    }
1269201
function reflection_getMethodInfo($method_name)
    {
        /** http://www.flickr.com/services/api/flickr.reflection.getMethodInfo.html */
        $this->request("flickr.reflection.getMethodInfo", array("method_name" => $method_name));
        return $this->parsed_response ? $this->parsed_response : false;
    }
685266
def is_form_get(attr, attrs):
    """"""
    res = False
    if attr == "action":
        method = attrs.get_true('method', u'').lower()
        res = method != 'post'
    return res
549767
protected function pullFromOptions($name, $method)
    {
        if (Arr::get($this->formOptions, $name) !== null) {
            $this->{$method}(Arr::pull($this->formOptions, $name));
        }
    }