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


PHP Gadget::getView方法代碼示例

本文整理匯總了PHP中Gadget::getView方法的典型用法代碼示例。如果您正苦於以下問題:PHP Gadget::getView方法的具體用法?PHP Gadget::getView怎麽用?PHP Gadget::getView使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Gadget的用法示例。


在下文中一共展示了Gadget::getView方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setUp

 /**
  * Prepares the environment before running a test.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->gadgetContext = new GadgetContext('GADGET');
     $gadgetSpecFactory = new MockRewriterGadgetFactory($this->gadgetContext, null);
     $gadgetSpecFactory->fetchGadget = null;
     $this->gadget = $gadgetSpecFactory->createGadget();
     $this->gadgetRewriter = new GadgetRewriter($this->gadgetContext);
     $this->view = $this->gadget->getView($this->gadgetContext->getView());
 }
開發者ID:emma5021,項目名稱:toba,代碼行數:13,代碼來源:GadgetRewriterTest.php

示例2: getIframeURL

 private function getIframeURL(Gadget $gadget, GadgetContext $context)
 {
     $v = $gadget->getChecksum();
     $view = $gadget->getView($context->getView());
     $up = '';
     foreach ($gadget->gadgetSpec->userPrefs as $pref) {
         $up .= '&up_' . urlencode($pref['name']) . '=' . urlencode($pref['value']);
     }
     $locale = $context->getLocale();
     //Note: putting the URL last, else some browsers seem to get confused (reported by hi5)
     return Config::get('default_iframe_prefix') . 'container=' . $context->getContainer() . ($context->getIgnoreCache() ? '&nocache=1' : '&v=' . $v) . ($context->getModuleId() != 0 ? '&mid=' . $context->getModuleId() : '') . '&lang=' . $locale['lang'] . '&country=' . $locale['country'] . '&view=' . $view['view'] . $up . '&url=' . urlencode($context->getUrl());
 }
開發者ID:vuxuandung,項目名稱:Partuza-bundle,代碼行數:12,代碼來源:MetadataHandler.php

示例3: renderGadget

 /**
  *
  * @param Gadget $gadget
  * @throws GadgetException
  */
 protected function renderGadget(Gadget $gadget)
 {
     $view = $gadget->getView($this->context->getView());
     $renderClasses = Config::get('gadget_renderer');
     foreach ($renderClasses as $renderClass => $constraints) {
         // if current view meets the configurated renderer constraints
         // render the gadget and stop checking
         if ($this->checkConstraints($view, $constraints)) {
             $gadgetRenderer = new $renderClass($this->context);
             $gadgetRenderer->renderGadget($gadget, $view);
             return;
         }
     }
     throw new GadgetException("Invalid view type");
 }
開發者ID:newlongwhitecloudy,項目名稱:OpenConext-engineblock,代碼行數:20,代碼來源:GadgetRenderingServlet.php

示例4: renderGadget

 protected function renderGadget(Gadget $gadget)
 {
     $view = $gadget->getView($this->context->getView());
     if ($view['type'] == 'URL') {
         require_once "src/gadgets/render/GadgetUrlRenderer.php";
         $gadgetRenderer = new GadgetUrlRenderer($this->context);
     } elseif ($view['type'] == 'HTML' && empty($view['href'])) {
         require_once "src/gadgets/render/GadgetHtmlRenderer.php";
         $gadgetRenderer = new GadgetHtmlRenderer($this->context);
     } elseif (empty($view['type']) || !empty($view['href'])) {
         require_once "src/gadgets/render/GadgetHrefRenderer.php";
         $gadgetRenderer = new GadgetHrefRenderer($this->context);
     } else {
         throw new GadgetException("Invalid view type");
     }
     $gadgetRenderer->renderGadget($gadget, $view);
 }
開發者ID:ndkhoiits,項目名稱:gatein-shindig,代碼行數:17,代碼來源:GadgetRenderingServlet.php

示例5: testGetView

 /**
  * Tests Gadget->getView()
  */
 public function testGetView()
 {
     $this->Gadget->views = array(0 => 'A', 1 => 'B');
     $this->assertEquals('B', $this->Gadget->getView(1));
 }
開發者ID:dalinhuang,項目名稱:shopexts,代碼行數:8,代碼來源:GadgetTest.php


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