本文整理汇总了PHP中Nette\Forms\IControl::getErrors方法的典型用法代码示例。如果您正苦于以下问题:PHP IControl::getErrors方法的具体用法?PHP IControl::getErrors怎么用?PHP IControl::getErrors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nette\Forms\IControl
的用法示例。
在下文中一共展示了IControl::getErrors方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderErrors
/**
* Renders validation errors (per form or per control).
* @param \Nette\Forms\IControl $control
* @return string
*/
public function renderErrors(\Nette\Forms\IControl $control = NULL, $own = true)
{
$errors = $control ? $control->getErrors() : ($own ? $this->form->getOwnErrors() : $this->form->getErrors());
if (count($errors)) {
$wrapper = \Nette\Utils\Html::el('ul class="alert-box alert radius"');
$wrapper->addAttributes(array('data-alert' => ''));
$wrapper->add('<a href="#" class="close">×</a>');
foreach ($errors as $error) {
$item = \Nette\Utils\Html::el('li');
$item->setHtml($error);
$wrapper->add($item);
}
$blockWrapper = \Nette\Utils\Html::el('div class="large-12 columns"');
$blockWrapper->setHtml($wrapper);
$rowWrapper = \Nette\Utils\Html::el('div class="row"');
$rowWrapper->setHtml($blockWrapper);
return $rowWrapper->render(0);
}
}
示例2: renderControlErrors
public function renderControlErrors(IControl $control)
{
$container = clone $this->prototypes->getControlErrors();
foreach ($control->getErrors() as $error) {
$el = clone $this->prototypes->getControlError();
$this->addContent($el->getPlaceholder(), $error);
$container->getPlaceholder()->addHtml($el);
}
return $container;
}
示例3: renderErrors
/**
* Renders validation errors (per form or per control).
* @return string
*/
public function renderErrors(Nette\Forms\IControl $control = NULL)
{
$errors = $control === NULL ? $this->form->getErrors() : $control->getErrors();
if (count($errors)) {
$ul = $this->getWrapper('error container');
$li = $this->getWrapper('error item');
foreach ($errors as $error) {
$item = clone $li;
if ($error instanceof Html) {
$item->add($error);
} else {
$item->setText($error);
}
$ul->add($item);
}
return "\n" . $ul->render(0);
}
}
示例4: renderErrors
/**
* Renders validation errors (per form or per control).
* @return string
*/
public function renderErrors(Nette\Forms\IControl $control = NULL, $own = TRUE)
{
$errors = $control ? $control->getErrors() : ($own ? $this->form->getOwnErrors() : $this->form->getErrors());
if (!$errors) {
return;
}
$container = $this->getWrapper($control ? 'control errorcontainer' : 'error container');
$item = $this->getWrapper($control ? 'control erroritem' : 'error item');
foreach ($errors as $error) {
$item = clone $item;
if ($error instanceof Html) {
$item->add($error);
} else {
$item->setText($error);
}
$container->add($item);
}
return "\n" . $container->render($control ? 1 : 0);
}
示例5:
Nette\Forms\Controls\HiddenField&&!$control->getOption('rendered')){$s.=(string)$control->getControl();}}if(iterator_count($this->form->getComponents(TRUE,'Nette\Forms\Controls\TextInput'))<2){$s.='<!--[if IE]><input type=IEbug disabled style="display:none"><![endif]-->';}if($s){$s=$this->getWrapper('hidden container')->setHtml($s)."\n";}return$s.$this->form->getElementPrototype()->endTag()."\n";}function
renderErrors(Nette\Forms\IControl$control=NULL){$errors=$control===NULL?$this->form->getErrors():$control->getErrors();if(count($errors)){$ul=$this->getWrapper('error container');$li=$this->getWrapper('error item');foreach($errors
as$error){$item=clone$li;if($error
instanceof
Html){$item->add($error);}else{$item->setText($error);}$ul->add($item);}return"\n".$ul->render(0);}}function