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