当前位置: 首页>>代码示例>>PHP>>正文


PHP Form::render方法代码示例

本文整理汇总了PHP中Nette\Application\UI\Form::render方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::render方法的具体用法?PHP Form::render怎么用?PHP Form::render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Nette\Application\UI\Form的用法示例。


在下文中一共展示了Form::render方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: render

 public function render()
 {
     $renderer = $this->getRenderer();
     $renderer->wrappers['controls']['container'] = NULL;
     $renderer->wrappers['pair']['container'] = 'div class=form-group';
     $renderer->wrappers['pair']['.error'] = 'has-error';
     $renderer->wrappers['control']['container'] = 'div class=col-sm-9';
     $renderer->wrappers['label']['container'] = 'div class="col-sm-3 control-label"';
     $renderer->wrappers['control']['description'] = 'span class=help-block';
     $renderer->wrappers['control']['errorcontainer'] = 'span class=help-block';
     if (!in_array("form-horizontal", $this->classes) && !in_array("form-inline", $this->classes)) {
         $this->classes[] = "form-horizontal";
     }
     $this->getElementPrototype()->class(implode(" ", $this->classes));
     foreach ($this->getControls() as $control) {
         if ($control instanceof \Nette\Forms\Controls\Button) {
             $control->getControlPrototype()->addClass(empty($usedPrimary) ? 'btn btn-primary' : 'btn btn-default');
             $usedPrimary = TRUE;
         } elseif ($control instanceof \Nette\Forms\Controls\TextBase || $control instanceof \Nette\Forms\Controls\SelectBox || $control instanceof \Nette\Forms\Controls\MultiSelectBox) {
             $control->getControlPrototype()->addClass('form-control');
         } elseif ($control instanceof \Nette\Forms\Controls\Checkbox || $control instanceof \Nette\Forms\Controls\CheckboxList || $control instanceof \Nette\Forms\Controls\RadioList) {
             $control->getSeparatorPrototype()->setName('div')->addClass($control->getControlPrototype()->type);
         }
     }
     parent::render();
 }
开发者ID:hajek-raven,项目名称:agenda,代码行数:26,代码来源:BaseForm.php

示例2: render

 public function render()
 {
     $renderer = $this->getRenderer();
     $renderer->wrappers['controls']['container'] = 'table class="form"';
     $renderer->wrappers['pair']['container'] = 'tr';
     $renderer->wrappers['label']['container'] = 'td';
     $renderer->wrappers['control']['container'] = 'td';
     parent::render();
 }
开发者ID:vsek,项目名称:formExtension,代码行数:9,代码来源:FormAdmin.php

示例3: render

 /**
  * Render form
  */
 public function render(...$args)
 {
     if ($this->readonly) {
         foreach ($this->getControls() as $control) {
             $control->controlPrototype->readonly = 'readonly';
         }
     }
     if ($this->tooltips) {
         foreach ($this->getControls() as $control) {
             $control->controlPrototype->{"data-toggle"}('tooltip');
             $control->controlPrototype->{"data-placement"}('right');
         }
     }
     parent::render(...$args);
     // TODO: Change the autogenerated stub
 }
开发者ID:mepatek,项目名称:application,代码行数:19,代码来源:Form.php

示例4: render

 public function render()
 {
     if ($this->renderStyle == self::BOOTSTRAP) {
         $renderer = $this->getRenderer();
         $renderer->wrappers['controls']['container'] = '';
         $renderer->wrappers['pair']['container'] = 'div  class="control-group"';
         $renderer->wrappers['label']['container'] = NULL;
         $renderer->wrappers['label']['requiredsuffix'] = ' <strong class="text-error">*</strong>';
         $renderer->wrappers['control']['container'] = 'div class="controls"';
         $renderer->wrappers['control']['description'] = 'span class="help-inline"';
         $renderer->wrappers['control']['errorcontainer'] = 'span class="text-error"';
         $renderer->wrappers['error']['container'] = 'ul class="alert alert-error"';
     }
     if ($this->renderStyle == self::SEMANTIC) {
         $renderer = $this->getRenderer();
         $renderer->wrappers = array('form' => array('container' => NULL), 'error' => array('container' => 'div class="ui error message"', 'item' => 'p'), 'group' => array('container' => 'fieldset', 'label' => 'legend', 'description' => 'p'), 'controls' => array('container' => 'div class="ui form "'), 'pair' => array('container' => 'div class=field', '.required' => '', '.optional' => NULL, '.odd' => NULL), 'control' => array('container' => 'div class="ui input"', '.odd' => NULL, 'description' => 'small', 'requiredsuffix' => '<div class="ui corner bluejeans label"><i class="icon asterisk"></i></div>', 'errorcontainer' => 'div class=ui red pointing above ui label', 'erroritem' => 'div class="ui red pointing above ui label"', '.required' => 'required', '.text' => 'text', '.password' => 'password', '.file' => 'file', '.submit' => 'ui button', '.image' => 'ui button', '.button' => 'ui button'), 'label' => array('container' => NULL, 'suffix' => NULL, 'requiredsuffix' => ' <strong class="ui bluejeans text">*</strong>'), 'hidden' => array('container' => NULL));
     }
     parent::render();
 }
开发者ID:soundake,项目名称:pd,代码行数:19,代码来源:MyForm.php

示例5: render

 public function render()
 {
     $renderer = $this->getRenderer();
     $renderer->wrappers['controls']['container'] = NULL;
     $renderer->wrappers['pair']['container'] = 'div class=form-group';
     $renderer->wrappers['pair']['.error'] = 'has-error';
     $renderer->wrappers['control']['container'] = 'div class=col-sm-9';
     $renderer->wrappers['label']['container'] = 'div class="col-sm-3 control-label"';
     $renderer->wrappers['control']['description'] = 'span class=help-block';
     $renderer->wrappers['control']['errorcontainer'] = 'span class=help-block';
     // make form and controls compatible with Twitter Bootstrap
     $this->getElementPrototype()->class('form-horizontal');
     foreach ($this->getControls() as $control) {
         if ($control instanceof Controls\Button) {
             $control->getControlPrototype()->addClass(empty($usedPrimary) ? 'btn btn-primary' : 'btn btn-default');
             $usedPrimary = TRUE;
         } elseif ($control instanceof Controls\TextBase || $control instanceof Controls\SelectBox || $control instanceof Controls\MultiSelectBox) {
             $control->getControlPrototype()->addClass('form-control');
         } elseif ($control instanceof Controls\Checkbox || $control instanceof Controls\CheckboxList || $control instanceof Controls\RadioList) {
             $control->getSeparatorPrototype()->setName('div')->addClass($control->getControlPrototype()->type);
         }
     }
     parent::render();
 }
开发者ID:greeny,项目名称:sandbox,代码行数:24,代码来源:Form.php

示例6: render

 /**
  * @inheritdoc
  */
 public function render(...$args)
 {
     $decorator = new Bootstrap3FormDecorator($this);
     $decorator->decorate();
     parent::render();
 }
开发者ID:Achse,项目名称:petrhejna,代码行数:9,代码来源:BaseForm.php


注:本文中的Nette\Application\UI\Form::render方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。