当前位置: 首页>>代码示例>>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;未经允许,请勿转载。