head() static public method

表单头部
static public head ( $form_name, $method = 'post', $action = '', $if_upload = false, $attrArray = null ) : string
$form_name
$method
$action
$if_upload
$attrArray
return string
Example #1
0
 function test()
 {
     $me = createModel('Me');
     if ($_POST) {
         if (!$me->checkForm($_POST, 'add', $error)) {
             Swoole\JS::js_back($error);
             return;
         }
         echo 'ok';
     } else {
         $form = $me->getForm();
         $this->swoole->tpl->assign('head', Swoole\Form::head('me_add', 'post', '', true));
         $this->swoole->tpl->assign('js', Swoole\Form::js('me_add'));
         $this->swoole->tpl->assign('form', $form);
         $this->swoole->tpl->display('test.html');
     }
 }