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


PHP Zend_View::clearVars方法代码示例

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


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

示例1: getFeedbackMail

 /**
  * Erstellt ein Feedback-Mail Objekt mit entsprechenden Daten
  *
  * @param   \Cms\Feedback $feedback
  * @return  \Cms\Mail
  */
 public function getFeedbackMail(\Cms\Feedback $feedback, $charset = 'utf-8')
 {
     $locale = new SbLocale('de');
     $this->view->clearVars();
     $this->view->feedback = $feedback;
     $renewMail = new \Cms\Mail($charset);
     $renewMail->setBodyText(utf8_encode($this->view->render($this->getTemplateFilename(__FUNCTION__, $locale))), $charset);
     $renewMail->setFrom($feedback->getEmail());
     $renewMail->setSubject($feedback->getSubject());
     $renewMail->addTo(Registry::getConfig()->feedback->mail->adress);
     return $renewMail;
 }
开发者ID:rukzuk,项目名称:rukzuk,代码行数:18,代码来源:MailBuilder.php

示例2: getRenderedContent

 /**
  *
  * @param int|array $id
  * @param string $type
  * @return array Rendered content items
  */
 function getRenderedContent($ids, $type = 'List')
 {
     if (!is_array($ids)) {
         $ids = array($ids);
     }
     foreach ($ids as $id) {
         if (!is_object($id)) {
             $item = $this->load($id, $type);
         } else {
             $item = $id;
         }
         $can_edit = Zoo::getService('acl')->checkItemAccess($item, 'edit');
         $cacheid = "Content_node" . $type . "_" . $item->id . ($can_edit ? "_edit" : "");
         try {
             $cached = Zoo::getService("cache")->load($cacheid);
             if ($cached) {
                 $content[] = $cached;
             }
         } catch (Zoo_Exception_Service $e) {
             // Cache service unavailable, set content to empty string
             $cached = false;
         }
         if (!$cached) {
             // Render content item
             if (!$this->view) {
                 $view = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer')->view;
                 /* @var $view Zend_View_Abstract */
                 // Don't clone the view until it is needed
                 $this->view = clone $view;
                 $this->view->clearVars();
             }
             list($module, $nodetype) = explode('_', $item->type);
             $this->resetView($module, $nodetype);
             $this->addLanguage($module);
             $this->view->assign('item', $item);
             $this->view->assign('can_edit', $can_edit);
             $rendered = $this->view->render($type == "Display" ? "index" : $type);
             $content[] = $rendered;
             try {
                 Zoo::getService('cache')->save($rendered, $cacheid, array('node' . $type, 'node_' . $item->id), null);
             } catch (Zoo_Exception_Service $e) {
                 // Cache service not available, do nothing
             }
         }
     }
     return $content;
 }
开发者ID:BGCX261,项目名称:zoocms-svn-to-git,代码行数:53,代码来源:Content.php

示例3: testClearVars

 /**
  * Test that array properties are cleared following clearVars() call
  */
 public function testClearVars()
 {
     $view = new Zend_View();
     $view->foo = array();
     $view->content = 'content';
     $this->assertTrue(is_array($view->foo));
     $this->assertEquals('content', $view->content);
     $view->clearVars();
     $this->assertFalse(isset($view->foo));
     $this->assertFalse(isset($view->content));
 }
开发者ID:jsnshrmn,项目名称:Suma,代码行数:14,代码来源:ViewTest.php

示例4: render

 /**
  * Renders the provided script.
  *
  * @param string $script
  * @param array(string=>mixed) $parameters
  * @return string The rendered content.
  */
 protected function render($script, array $parameters)
 {
     $this->view->clearVars();
     $this->view->assign($parameters);
     return $this->view->render($script);
 }
开发者ID:matthimatiker,项目名称:molcomponents,代码行数:13,代码来源:Factory.php


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