当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_View_Interface::getHelper方法代码示例

本文整理汇总了PHP中Zend_View_Interface::getHelper方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_View_Interface::getHelper方法的具体用法?PHP Zend_View_Interface::getHelper怎么用?PHP Zend_View_Interface::getHelper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_View_Interface的用法示例。


在下文中一共展示了Zend_View_Interface::getHelper方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: renderVimeoWidget

 public function renderVimeoWidget($params = array())
 {
     # Prepare
     $oembed_endpoint = 'http://www.vimeo.com/api/oembed';
     # Extract
     $video_url = $params['content'];
     # Create the URLs
     $json_url = $oembed_endpoint . '.json?url=' . rawurlencode($video_url);
     # Load in the oEmbed Object
     $Oembed = @file_get_contents($json_url);
     if (!$Oembed) {
         return '<p>The Vimeo item could not be found.</p>';
     }
     $Oembed = json_decode($Oembed);
     # Apply the Model
     $model = compact('Oembed');
     $model = array_merge($params, $model);
     # Render
     return $this->view->getHelper('widget')->renderWidgetView(delve($params, 'partial', 'social/vimeo/vimeo'), $model);
 }
开发者ID:balupton,项目名称:balcms,代码行数:20,代码来源:Social.php

示例2: renderEventlistWidget

 /**
  * Renders the Eventlist Widget
  * 
  * @param array 			$params [optional]
  * 							The following options are provided:
  * 
  * @return string 			The following params are sent back to partial:
  * 								Content:		The Content object which is rendering this widget
  * 								EventsPast:		A Doctrine_Collection of Event objects which occurred in the past
  * 								EventsFuture:	A Doctrine_Collection of Event objects which will occur in the future
  */
 public function renderEventlistWidget(array $params = array())
 {
     # Prepare
     $timestamp = date('Y-m-d H:i:s', time());
     # Fetch
     $Content = $this->getContentObjectFromParams($params);
     $EventsPast = Doctrine_Query::create()->select('*')->from('ContentEvent c, c.Parent cp')->where('c.status = ? AND cp.id = ?', array('published', $Content->id))->orderBy('c.event_start_at ASC, c.id ASC')->limit(20)->andWhere('c.event_start_at < ?', $timestamp)->execute();
     $EventsFuture = Doctrine_Query::create()->select('*')->from('ContentEvent c, c.Parent cp')->where('c.status = ? AND cp.id = ?', array('published', $Content->id))->orderBy('c.event_start_at ASC, c.id ASC')->limit(20)->andWhere('c.event_start_at >= ?', $timestamp)->execute();
     # Apply
     $model = compact('Content', 'EventsPast', 'EventsFuture');
     $model = array_merge($params, $model);
     # Render
     return $this->view->getHelper('widget')->renderWidgetView(delve($params, 'partial', 'content/eventlist/eventlist'), $model);
     # Free
     if (FREE_RESOURCES) {
         $EventsPast->free(true);
         $EventsFuture->free(true);
     }
     # Return result
     return $result;
 }
开发者ID:balupton,项目名称:balcms,代码行数:32,代码来源:Content.php

示例3: setUp

 private function setUp(Zend_View_Interface $view)
 {
     if (!$this->isSetUp) {
         $helperName = 'Dfi_View_Helper_Navigation';
         $view->addHelperPath(_BASE_PATH . 'vendor/dafik/dfi/src/' . str_replace('_', '/', $helperName), $helperName);
     }
     /** @var $helper Zend_View_Helper_Navigation */
     $helper = $view->getHelper('navigation');
     if (!$this->isSetUp) {
         $helper->navigation($this->navigation);
         $aclPlugin = Zend_Controller_Front::getInstance()->getPlugin('Dfi_Controller_Plugin_Acl');
         if ($aclPlugin) {
             $acl = Zend_Registry::get('acl');
             /* @var $acl Zend_Acl */
             $identity = Zend_Auth::getInstance()->getIdentity();
             /* @var $identity SysUser */
             if ($acl && $identity) {
                 /* @var $helper Zend_View_Helper_Navigation_Menu */
                 $helper->setAcl($acl);
                 $helper->setRole((string) $identity->getRoleId());
             }
         }
         $this->isSetUp = true;
     }
     return $helper;
 }
开发者ID:dafik,项目名称:dfi,代码行数:26,代码来源:Navigation.php

示例4: getCallback

 /**
  * returns a callback to the plugin, this is used with the reflection API to
  * find out about the plugin's parameter names etc.
  *
  * should you need a rest array (i.e. for ZendFramework helpers) without the
  * possibility to edit the plugin's code, you can provide a callback to some
  * other function with the correct parameter signature, i.e. :
  * <code>
  * return array($this, "callbackHelper");
  * // and callbackHelper would be as such:
  * public function callbackHelper(array $rest=array()){}
  * </code>
  *
  * @param string $name the plugin name
  * @return callback
  */
 public function getCallback($name)
 {
     return array($this->view->getHelper($name), $name);
 }
开发者ID:johnny-s,项目名称:itsplanned.com,代码行数:20,代码来源:PluginProxy.php


注:本文中的Zend_View_Interface::getHelper方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。