예제 #1
0
 /**
  * {@inheritDoc}
  *
  * @param string $id
  */
 public function render($container = null)
 {
     if (!$this->getPartial()) {
         return $this->renderStraight($container);
     }
     return parent::render($container);
 }
예제 #2
0
 public function testRenderingPartialShouldFailOnInvalidPartialArray()
 {
     $this->_helper->setPartial(array('bc.phtml'));
     try {
         $this->_helper->render();
         $this->fail('$partial was invalid, but no Zend\\View\\Exception\\ExceptionInterface was thrown');
     } catch (ExceptionInterface $e) {
     }
 }
예제 #3
0
 /**
  * Renders helper
  *
  * Implements {@link HelperInterface::render()}.
  *
  * @param  AbstractContainer $container
  *      [optional] container to render. Default is
  *      to render the container registered in the helper.
  * @return string
  */
 public function render($container = null)
 {
     Pi::service('log')->start('breadcrumbs');
     // Try to load from cache
     if ($this->cache) {
         $cacheKey = $this->cache->key . '-bs';
         $content = $this->cache->storage->getItem($cacheKey);
         if (null !== $content) {
             if (Pi::service()->hasService('log')) {
                 Pi::service('log')->info('Breadcrumbs is loaded from cache.');
             }
             return $content;
         }
     }
     // Generate if no cache available
     $content = parent::render($container);
     // Save to cache
     if ($this->cache) {
         $this->cache->storage->setItem($cacheKey, $content);
     }
     Pi::service('log')->end('breadcrumbs');
     return $content;
 }