當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Control::attached方法代碼示例

本文整理匯總了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;
 }
開發者ID:osmcz,項目名稱:website,代碼行數:12,代碼來源:MetaControl.php

示例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));
 }
開發者ID:osmcz,項目名稱:website,代碼行數:15,代碼來源:ShopPlugin.php

示例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;
     }
 }
開發者ID:osmcz,項目名稱:website,代碼行數:43,代碼來源:FieldsPlugin.php

示例4: attached

 protected function attached($presenter)
 {
     parent::attached($presenter);
     self::$presenter = $presenter;
     $this->user = $presenter->getUser();
 }
開發者ID:radypala,項目名稱:maga-website,代碼行數:6,代碼來源:BaseControl.php


注:本文中的Control::attached方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。