本文整理汇总了PHP中Widget::getErrors方法的典型用法代码示例。如果您正苦于以下问题:PHP Widget::getErrors方法的具体用法?PHP Widget::getErrors怎么用?PHP Widget::getErrors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Widget
的用法示例。
在下文中一共展示了Widget::getErrors方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: let
function let(\Widget $widget)
{
$widget->getErrors()->willReturn(array());
$this->beConstructedWith($widget);
if (!class_exists('FrontendTemplate', false)) {
class_alias('spec\\Netzmacht\\Contao\\FormHelper\\FrontendTemplate', 'FrontendTemplate');
}
if (!isset($GLOBALS['TL_FFL'])) {
$GLOBALS['TL_FFL'] = array();
}
}
示例2: Node
function it_creates_a_view(\Widget $widget, EventDispatcher $eventDispatcher)
{
$widget->getErrors()->willReturn(array());
$eventDispatcher->dispatch(Events::CREATE_VIEW, Argument::type(self::VIEW_EVENT_CLASS))->shouldBeCalled();
$eventDispatcher->dispatch(Events::CREATE_ELEMENT, Argument::type(self::CREATE_ELEMENT_EVENT_CLASS))->will(function ($args) {
/** @var CreateElementEvent $event */
$event = $args[1];
$event->setElement(new Node('input'));
});
$eventDispatcher->dispatch(Events::PRE_GENERATE_VIEW, Argument::type(self::VIEW_EVENT_CLASS))->shouldBeCalled();
$eventDispatcher->dispatch(Events::GENERATE_VIEW, Argument::type(self::VIEW_EVENT_CLASS))->shouldBeCalled();
$this->createView($widget)->shouldBeAnInstanceOf(self::VIEW_CLASS);
}
示例3: __construct
/**
* Construct.
*
* @param \Widget $widget The form widget.
* @param \FormModel $formModel Optional the corresponding form model.
*/
public function __construct(\Widget $widget, \FormModel $formModel = null)
{
$this->widget = $widget;
$this->formModel = $formModel;
$this->attributes = new Attributes();
$this->container = new Container();
$this->label = new Label();
$this->errors = new Errors($widget->getErrors());
$this->widgetType = WidgetUtil::getType($widget);
}