當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。