本文整理汇总了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();
}
示例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();
}
示例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
}
示例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();
}
示例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();
}
示例6: render
/**
* @inheritdoc
*/
public function render(...$args)
{
$decorator = new Bootstrap3FormDecorator($this);
$decorator->decorate();
parent::render();
}