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


PHP Zend_View::setHelperPath方法代码示例

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


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

示例1: _initView

 public function _initView()
 {
     // Initialize view
     $view = new Zend_View();
     // Setup Helper Paths
     $view->setHelperPath(SM_LIB . DIRECTORY_SEPARATOR . 'View' . DIRECTORY_SEPARATOR . 'Helper', 'Smallunch_lib_View_Helper');
     // Add Global Helper path (typically application/helpers
     $view->addHelperPath(GLOBAL_HELPER_DIR . DIRECTORY_SEPARATOR . 'View');
     // add per application helper path (typically application/(backend, frontend)/helpers
     $view->addHelperPath(APPLICATION_DIRECTORY . DIRECTORY_SEPARATOR . 'Helper' . DIRECTORY_SEPARATOR . 'View');
     // Setup layout
     if (isset($this->config->layout->doctype)) {
         $view->doctype($this->config->layout->doctype);
     }
     if (isset($this->config->default->title)) {
         $view->headTitle($this->config->default->title);
     }
     if (isset($this->config->default->meta_keywords)) {
         $view->headMeta($this->config->default->meta_keywords, 'keywords');
     }
     if (isset($this->config->default->meta_description)) {
         $view->headMeta($this->config->default->meta_description, 'description');
     }
     if (isset($this->config->layout->charset)) {
         $view->headMeta()->appendHttpEquiv('Content-Type', 'text/html; charset=' . $this->config->layout->charset);
     }
     if (isset($this->config->layout->content_language)) {
         $view->headMeta()->appendHttpEquiv('Content-Language', $this->config->layout->content_language);
     }
     // Add it to the ViewRenderer
     $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
     $viewRenderer->setView($view);
     // Return it, so that it can be stored by the bootstrap
     return $view;
 }
开发者ID:jeremymoorecom,项目名称:Smallunch,代码行数:35,代码来源:Bootstrap.php

示例2: render

 public function render($datas)
 {
     $this->_scriptName = $datas->scriptName;
     # html mail
     // needed: email, passwd, scriptname
     $file = APPLICATION_PATH . '/configs/langs/' . $datas->lang . '/emails.ini';
     $texts = new Zend_Config_Ini($file, $this->_scriptName);
     $view = new Zend_View();
     $view->setScriptPath($this->_config->mail->scriptsPath);
     $view->setHelperPath($this->_config->mail->helpersPath);
     //    switch sur la lang pour header
     switch ($datas->lang) {
         case 'befl':
         case 'befr':
         case 'nl':
             $view->top = 'top_challenge.jpg';
             break;
         default:
             $view->top = 'top.jpg';
             break;
     }
     $view->texts = $texts;
     $view->assign((array) $datas->view);
     $view->webhost = $this->_config->site->webhost;
     $view->tplname = $this->_scriptName;
     //    on gere le setFrom ici car localisé
     $this->setFrom($this->_config->mail->addressFrom, $texts->labelFrom);
     $this->_document = $view->render($this->_scriptName . '.phtml');
     $this->setSubject(utf8_decode($texts->subject));
     $this->setBodyHtml($this->_document, 'utf-8');
     $this->addTo($datas->view->email);
     $this->send();
 }
开发者ID:AlexChien,项目名称:bbcoach,代码行数:33,代码来源:_Mailer.php

示例3: getView

 public function getView()
 {
     if (null === $this->_view) {
         $options = $this->getOptions();
         $title = '';
         $doctype = '';
         $contentType = 'text/html; charset=iso-8859-1';
         if (array_key_exists('title', $options)) {
             $title = $options['title'];
             unset($options['title']);
         }
         if (isset($options['doctype'])) {
             $doctype = $options['doctype'];
             unset($options['doctype']);
         }
         if (isset($options['content-type'])) {
             $contentType = $options['content-type'];
             unset($options['content-type']);
         }
         $view = new Zend_View($options);
         $view->doctype($doctype);
         $view->headTitle($title);
         $view->headMeta()->setHttpEquiv('content-type', $contentType);
         $view->setHelperPath(LIBRARY_PATH . DS . 'Webbers/View/Helper', 'Webbers_View_Helper');
         $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
         $viewRenderer->setViewSuffix('inc');
         $viewRenderer->setView($view);
         $this->_view = $view;
     }
     return $this->_view;
 }
开发者ID:jager,项目名称:cms,代码行数:31,代码来源:View.php

示例4: __construct

 public function __construct($options, $seotoasterData)
 {
     // setting up Seotoaster data and plugin options
     $this->_options = $options;
     $this->_seotoasterData = $seotoasterData;
     // setting up helpers
     $this->_sessionHelper = Zend_Controller_Action_HelperBroker::getStaticHelper('session');
     $this->_websiteHelper = Zend_Controller_Action_HelperBroker::getStaticHelper('website');
     $this->_responseHelper = Zend_Controller_Action_HelperBroker::getStaticHelper('response');
     $this->_redirector = new Zend_Controller_Action_Helper_Redirector();
     // setting up request and response objects
     $front = Zend_Controller_Front::getInstance();
     $this->_request = $front->getRequest();
     $this->_response = $front->getResponse();
     unset($front);
     // setting up view
     $this->_view = new Zend_View();
     $this->_websiteUrl = $this->_websiteHelper->getUrl();
     $this->_pluginName = strtolower(__CLASS__);
     $this->_view->websiteUrl = $this->_websiteUrl;
     $this->_view->pluginName = $this->_pluginName;
     // setting up view helpers (standart and ZendX)
     $this->_view->setHelperPath(APPLICATION_PATH . '/views/helpers/');
     $this->_view->addHelperPath('ZendX/JQuery/View/Helper/', 'ZendX_JQuery_View_Helper');
     // runing init routines
     $this->_initAcl();
     $this->_initTranslator();
     $this->_init();
 }
开发者ID:PavloKovalov,项目名称:seotoaster,代码行数:29,代码来源:Abstract.php

示例5: setupView

 public function setupView($crt_theme)
 {
     $view = new Zend_View();
     $view->setEncoding('UTF-8');
     $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer($view);
     Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
     $view->setScriptPath($this->root . '/application/' . $crt_theme . '/scripts/');
     $view->setHelperPath($this->root . '/application/' . $crt_theme . '/helpers');
     $this->layout = Zend_Layout::startMvc(array('layoutPath' => $this->root . '/application/' . $crt_theme . '/layouts', 'layout' => 'layout'));
 }
开发者ID:aliinfotech,项目名称:netefct,代码行数:10,代码来源:Bootstrap.php

示例6: _initView

 protected function _initView()
 {
     $view = new Zend_View();
     $view->doctype('HTML5');
     $view->headTitle()->setSeparator(' | ');
     $view->headMeta()->appendHttpEquiv('Content-Type', 'text/html; charset=utf-8');
     $view->setHelperPath(APPLICATION_PATH . '/modules/admin/views/helpers/');
     $view->addHelperPath(APPLICATION_PATH . '/modules/public/views/helpers/');
     Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer')->setView($view);
 }
开发者ID:Rademade,项目名称:MedOptima,代码行数:10,代码来源:Bootstrap.php

示例7: RenderApplet

 /**
  * comments
  */
 public function RenderApplet($applet)
 {
     $config = Zend_Registry::get('config');
     //create a new instance of view
     $appletView = new Zend_View();
     $appletView->setScriptPath($config->view->applet->path . '/' . $applet);
     $appletView->setHelperPath($config->view->applet->path . '/' . $applet, 'Digitalus_Applet');
     //tell the applet about where it is
     $appletView->page = $this->view->page;
     $appletView->pageObj = $this->view->pageObj;
     //run the code behind
     if (file_exists($config->view->applet->path . '/' . $applet . '/' . $applet . '.php')) {
         $appletView->{$applet}();
     }
     return $appletView->render($applet . '.phtml');
 }
开发者ID:ngukho,项目名称:ducbui-cms,代码行数:19,代码来源:RenderApplet.php

示例8: _render

 /**
  * @desc create each mail object and send it to user
  * @param object $datas
  * @return void
  */
 private function _render($datas)
 {
     $this->mail = new Zend_Mail('UTF-8');
     $view = new Zend_View();
     $view->setScriptPath($this->_config->mail->scriptsPath);
     $view->setHelperPath($this->_config->mail->helpersPath);
     $view->tplname = $this->_scriptName;
     $lang = $datas->lang;
     $view->texts = $this->_texts->{$lang};
     //    switch sur la lang pour header
     switch ($datas->lang) {
         case 'befl':
         case 'befr':
         case 'nl':
             $view->top = 'top_challenge.jpg';
             break;
         default:
             $view->top = 'top.jpg';
             break;
     }
     //	selection de la video si template youtube
     if ($this->_scriptName == 'youtube') {
         if ($this->_day) {
             $view->urlVideo = $view->texts->{video . $this->_day};
             $view->day = $this->_day;
         } else {
             $day = Zend_Registry::get('week');
             $video = 'video' . $day;
             $view->urlVideo = $view->texts->{$video};
             $view->day = $day;
         }
     }
     $view->assign((array) $datas);
     $view->webhost = $this->_config->site->webhost;
     $this->_document = $view->render($this->_scriptName . '.phtml');
     $this->mail->setHeaderEncoding(Zend_Mime::ENCODING_BASE64);
     // $this->mail->setSubject(utf8_decode($view->texts->subject));
     $this->mail->setSubject($view->texts->subject);
     $this->mail->setBodyHtml($this->_document);
     $this->mail->addTo($datas->email, $datas->firstName);
     $this->mail->send();
 }
开发者ID:AlexChien,项目名称:bbcoach,代码行数:47,代码来源:Massmailer.php

示例9: _initViewHelpers

 /**
  * Add view Helpers
  */
 protected function _initViewHelpers()
 {
     $view = new Zend_View();
     /**
      * set helper Path
      */
     $view->setHelperPath(APPLICATION_PATH . '/helpers', '');
     /**
      * add jQuery helper path
      */
     $view->addHelperPath("ZendX/JQuery/View/Helper", "ZendX_JQuery_View_Helper");
     $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
     /**
      * add $view to the view renderer
      */
     $viewRenderer->setView($view);
     /**
      * add viewRenderer to ActionHelper
      */
     Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
     return $view;
 }
开发者ID:rohankoid,项目名称:Bookshelf,代码行数:25,代码来源:Bootstrap.php

示例10: testGetHelperWorksWithPredefinedClassNames

 /**
  * @group ZF-2742
  */
 public function testGetHelperWorksWithPredefinedClassNames()
 {
     $view = new Zend_View();
     $view->setHelperPath(dirname(__FILE__) . '/View/_stubs/HelperDir2');
     try {
         $view->setHelperPath(dirname(__FILE__) . '/View/_stubs/HelperDir1', null);
         $this->fail('Exception for empty prefix was expected.');
     } catch (Exception $e) {
         $this->assertContains('only takes strings', $e->getMessage());
     }
     try {
         $view->setHelperPath(dirname(__FILE__) . '/View/_stubs/HelperDir1', null);
         $this->fail('Exception for empty prefix was expected.');
     } catch (Exception $e) {
         $this->assertContains('only takes strings', $e->getMessage());
     }
     try {
         $helper = $view->getHelper('Datetime');
     } catch (Exception $e) {
         $this->assertContains('not found', $e->getMessage());
     }
 }
开发者ID:jsnshrmn,项目名称:Suma,代码行数:25,代码来源:ViewTest.php

示例11: testLoadHelperNonexistantClass

    /**
     * Tests that calling a helper whose file exists but class is not found within
     * throws the expected exception
     */
    public function testLoadHelperNonexistantClass()
    {
        $view = new Zend_View();

        $view->setHelperPath(array(dirname(__FILE__) . '/View/_stubs/HelperDir1'));

        try {
            // attempt to load the helper StubEmpty, whose file exists but
            // does not contain the expected class within
            $view->stubEmpty();	
            // @todo: fail if no exception?
        } catch (Zend_View_Exception $e) {
            $this->assertRegexp("/['_a-z]+ not found in path/i", $e->getMessage());
        }
    }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:19,代码来源:ViewTest.php

示例12: testGetHelperWorksWithPredefinedClassNames

    /**
     * @issue ZF-2742
     */
    public function testGetHelperWorksWithPredefinedClassNames()
    {
        $view = new Zend_View();

        $view->setHelperPath(dirname(__FILE__) . '/View/_stubs/HelperDir2');
        try {
            $view->setHelperPath(dirname(__FILE__) . '/View/_stubs/HelperDir1', null);
            $this->fail('Exception for empty prefix was expected.');
        } catch (Exception $e) {
            $this->assertEquals('The classPrefix cannot be empty.', $e->getMessage());
        }

        try {
            $view->setHelperPath(dirname(__FILE__) . '/View/_stubs/HelperDir1', null);
            $this->fail('Exception for empty prefix was expected.');
        } catch (Exception $e) {
            $this->assertEquals('The classPrefix cannot be empty.', $e->getMessage());
        }
        
        
        $helper = $view->getHelper('Datetime');
        $this->assertEquals('Zend_View_Helper_Datetime', get_class($helper));
    }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:26,代码来源:ViewTest.php

示例13: array

require_once 'Zend/Config/Ini.php';
require_once 'Zend/View.php';
require_once 'Zend/Locale.php';
require_once 'Zend/Controller/Action/HelperBroker.php';
require_once 'Zend/Translate.php';
require_once 'Zend/Registry.php';

$i18nConfig = new Zend_Config_Ini(APPLICATION_PATH . '/configs/i18n.ini', APPLICATION_ENV);
$appConfig = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini', APPLICATION_ENV);

// --- VIEW

// Initialize view
$view = new Zend_View();
$view->env = APPLICATION_ENV;
$view->setHelperPath(APPLICATION_PATH . '/layouts/helpers');

// Add it to the ViewRenderer
$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
$viewRenderer->setView($view);


// Language mapping ExtJS -> Zend
$langMapping = array(
    "en_US" => "ext-lang-en.js",
    "de_DE" => "ext-lang-de.js"
);


// --- TRANSLATE
开发者ID:renepardon,项目名称:ExtZF,代码行数:30,代码来源:generateLanguageFiles.php

示例14: _initView

 /**
  * Initialises the view renderer.
  *
  * @return Zend_View view renderer
  */
 protected function _initView()
 {
     /* Create the view. */
     $view = new Zend_View();
     $view->doctype('XHTML1_STRICT');
     $view->setHelperPath(self::$rootDirectory . '/views/helpers');
     /* Add it to the view renderer. */
     $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
     $viewRenderer->setView($view);
     Zend_Layout::startMvc(array('layoutPath' => self::$rootDirectory . '/views/layouts'));
     return $view;
 }
开发者ID:jeking3,项目名称:web-interface,代码行数:17,代码来源:Bootstrap.php

示例15: testLoadHelperNonexistantClass

 /**
  * Tests that calling a helper whose file exists but class is not found within
  * throws the expected exception
  */
 public function testLoadHelperNonexistantClass()
 {
     $view = new Zend_View();
     $view->setHelperPath(array(dirname(__FILE__) . '/_stubs/HelperDir1'));
     try {
         // attempt to load the helper StubEmpty, whose file exists but
         // does not contain the expected class within
         $view->stubEmpty();
     } catch (Zend_View_Exception $e) {
         $this->assertRegexp('/loaded but class [\'_A-z]+ not found/i', $e->getMessage());
     }
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:16,代码来源:ViewTest.php


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