本文整理匯總了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);
}