statefulFormTb() public static method

Generates a stateful form tag.
public static statefulFormTb ( $layout = self::FORM_LAYOUT_VERTICAL, mixed $action = '', string $method = 'post', array $htmlOptions = [] ) : string
$action mixed the form action URL.
$method string form method (e.g. post, get).
$htmlOptions array additional HTML attributes.
return string the generated form tag.
示例#1
0
 /**
  * Initializes the widget.
  */
 public function init()
 {
     $this->attachBehavior('TbWidget', new TbWidget());
     $this->copyId();
     if ($this->stateful) {
         echo TbHtml::statefulFormTb($this->layout, $this->action, $this->method, $this->htmlOptions);
     } else {
         echo TbHtml::beginFormTb($this->layout, $this->action, $this->method, $this->htmlOptions);
     }
 }
示例#2
0
 public function testStatefulForm()
 {
     $I = $this->codeGuy;
     $html = TbHtml::statefulFormTb(TbHtml::FORM_LAYOUT_VERTICAL, '#');
     $body = $I->createNode($html);
     $form = $body->filter('form');
     $I->seeNodeCssClass($form, 'form-vertical');
     $div = $body->filter('div');
     $I->seeNodeCssStyle($div, 'display: none');
     $input = $div->filter('input[type=hidden]');
     $I->seeNodeAttributes($input, array('name' => 'YII_PAGE_STATE', 'value' => ''));
 }