本文整理汇总了PHP中Control::attached方法的典型用法代码示例。如果您正苦于以下问题:PHP Control::attached方法的具体用法?PHP Control::attached怎么用?PHP Control::attached使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Control
的用法示例。
在下文中一共展示了Control::attached方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: attached
protected function attached($presenter)
{
parent::attached($presenter);
if (!$presenter instanceof Presenter) {
return;
}
//připojen presenter
if (!isset($presenter->page)) {
throw new InvalidStateException('MetaControl attached to uncompatible Presenter');
}
$this->page = $presenter->page;
}
示例2: attached
protected function attached($presenter)
{
parent::attached($presenter);
if (!$presenter instanceof Presenter) {
return;
}
//připojen presenter
if (!isset($presenter->page)) {
throw new InvalidStateException('ShopControl attached to uncompatible Presenter');
}
$this->page = $presenter->page;
$this->template->page = $presenter->page;
$this->template->lang = $presenter->lang;
$this->template->setTranslator(new TranslationsModel($presenter->lang));
}
示例3: attached
protected function attached($presenter)
{
parent::attached($presenter);
if (!$presenter instanceof Presenter) {
return;
}
//připojen presenter
if (!isset($presenter->page)) {
throw new InvalidStateException('FieldsPlugin attached to uncompatible Presenter');
}
$this->page = $presenter->page;
$this->template->page = $presenter->page;
$this->template->lang = $presenter->lang;
$this->template->setTranslator(new TranslationsModel($presenter->lang));
//parse fields
$json = $this->page->getParent()->getMeta('.sectionFields');
$sectionFields = array();
try {
if ($json) {
$sectionFields = Neon::decode($json);
}
} catch (Exception $e) {
$m = htmlspecialchars($e->getMessage());
$this->error .= "<div class='control-group' title=\"{$m}\">.sectionFields not valid</div>";
}
$fields = array();
$json = $this->page->getMeta('.fields');
try {
if ($json) {
$fields = Neon::decode($json);
}
} catch (Exception $e) {
$m = htmlspecialchars($e->getMessage() . "\"");
$this->error .= "<div class='control-group' title=\"{$m}\">.fields not valid</div>";
}
$fields = array_merge($fields, $sectionFields);
foreach ($fields as $k => $f) {
if (substr($k, -1) == '_') {
$k .= $this->page->lang;
}
$this->fields[$k] = $f;
}
}
示例4: attached
protected function attached($presenter)
{
parent::attached($presenter);
self::$presenter = $presenter;
$this->user = $presenter->getUser();
}