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


PHP Zend_View::getHelper方法代码示例

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


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

示例1: testHelperUsesServerAndBaseUrlFromHelpersByDefault

 public function testHelperUsesServerAndBaseUrlFromHelpersByDefault()
 {
     $base = $this->view->getHelper('baseUrl');
     $base->setBaseUrl('/foo/bar');
     $server = $this->view->getHelper('serverUrl');
     $server->setScheme('https')->setHost('example.com:8080');
     $test = $this->helper->getBaseUrl();
     $this->assertEquals('https://example.com:8080/foo/bar/', $test);
 }
开发者ID:sasezaki,项目名称:mirror-zf1-tests,代码行数:9,代码来源:TinySrcTest.php

示例2: testDatePickerOptionsAreRenderedInJavascript

 public function testDatePickerOptionsAreRenderedInJavascript()
 {
     $options = array('foo' => uniqid());
     $this->_picker->setDatePickerOptions($options);
     // render the element
     $this->_picker->render($this->_view);
     /** @var $jq ZendX_JQuery_View_Helper_JQuery_Container */
     $jq = $this->_view->getHelper('jQuery');
     // test for date picker customization
     $this->assertContains("\$('#{$this->_picker->getId()}').datepicker", implode('', $jq->getOnLoadActions()), 'DatePicker should be initialized by id');
     $this->assertContains(Zend_Json::encode($options), implode('', $jq->getOnLoadActions()), 'DatePicker should be initialized with custom options');
 }
开发者ID:JellyBellyDev,项目名称:zle,代码行数:12,代码来源:DatePickerTest.php

示例3: init

 public function init()
 {
     parent::init();
     $this->view->getHelper('headTitle')->headTitle('VAR_BASE_TITLE');
     $this->view->getHelper('HeadMeta')->appendHttpEquiv('pragma', 'no-cache')->appendHttpEquiv('Cache-Control', 'no-cache')->appendHttpEquiv('Content-Type', 'application/xhtml+xml; charset=UTF-8')->appendHttpEquiv('Content-Language', 'pl-PL');
     //		/->appendName('author', '');
     $this->view->getHelper('Doctype')->setDoctype(Zend_View_Helper_Doctype::XHTML11);
     $this->messages = Dfi_Controller_Action_Helper_Messages::getInstance();
     Zend_Controller_Action_HelperBroker::addHelper($this->messages);
     Zend_Auth::getInstance()->setStorage(new Dfi_Auth_Storage_Cookie('VAR_user'));
     /*   $this->messages->addMessage(Dfi_Controller_Action_Helper_Messages::TYPE_DEBUG, 'test  - DEBUG');
          $this->messages->addMessage('error', 'test');
          $this->messages->addMessage('confirmation', 'test');
          $this->messages->addMessage('notice', 'test');*/
     $this->view->addHelperPath('View/Helper', 'View_Helper');
     $this->view->addBasePath(APPLICATION_PATH . 'views/partials/');
 }
开发者ID:dafik,项目名称:zf-scaffold,代码行数:17,代码来源:ControllerDefaultModule.php

示例4: testBaseUrlUsedForFileLinks

 /**
  * Regression Test fuer OPUSVIER-3192.
  */
 public function testBaseUrlUsedForFileLinks()
 {
     $helper = new Application_View_Helper_FileLink();
     $view = new Zend_View();
     $view->getHelper('BaseUrl')->setBaseUrl('/testbase');
     $helper->setView($view);
     $file = new Opus_File(126);
     $this->assertEquals('<a href="http:///testbase/files/146/test.pdf">foo-pdf</a>' . '<input type="hidden" name="" value="126" id="" />', $helper->fileLink(null, $file, array('useFileLabel' => true)));
 }
开发者ID:belapp,项目名称:opus4-application,代码行数:12,代码来源:FileLinkTest.php

示例5: testRegisterHelperShouldRegisterHelperWithView

 /**
  * @group ZF-8177
  */
 public function testRegisterHelperShouldRegisterHelperWithView()
 {
     require_once dirname(__FILE__) . '/View/_stubs/HelperDir1/Stub1.php';
     $view = new Zend_View();
     $helper = new Foo_View_Helper_Stub1();
     $view->registerHelper($helper, 'stub1');
     $this->assertEquals($view->getHelper('stub1'), $helper);
     $this->assertEquals($view->stub1(), 'foo');
 }
开发者ID:jsnshrmn,项目名称:Suma,代码行数:12,代码来源:ViewTest.php

示例6: testGetHelperUsingDifferentCasesReturnsSameInstance

    public function testGetHelperUsingDifferentCasesReturnsSameInstance()
    {
        $view    = new Zend_View();
        $helper1 = $view->getHelper('formHidden');
        $helper2 = $view->getHelper('FormHidden');

        $this->assertSame($helper1, $helper2);
    }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:8,代码来源:ViewTest.php

示例7: 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->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:lortnus,项目名称:zf1,代码行数:25,代码来源:ViewTest.php

示例8: testGetHelper

 public function testGetHelper()
 {
     // require so we can do type hinting
     require_once 'Zend/View/Helper/DeclareVars.php';
     $view = new Zend_View();
     $view->declareVars();
     $helper = $view->getHelper('declareVars');
     $this->assertTrue($helper instanceof Zend_View_Helper_DeclareVars);
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:9,代码来源:ViewTest.php

示例9: 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

示例10: getHelper

 /**
  * Returns the mocked url helper.
  *
  * @return Mol_Test_View_Helper_Url
  */
 private function getHelper()
 {
     return $this->view->getHelper('Url');
 }
开发者ID:matthimatiker,项目名称:molcomponents,代码行数:9,代码来源:UrlTest.php


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