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


PHP Zend_Controller_Action_Helper_ViewRenderer::setActionController方法代码示例

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


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

示例1: testActionsWithLeadingCapitalLettersShouldNotInvokeTruncatedViewScripts

 /**
  * @group ZF-10725
  */
 public function testActionsWithLeadingCapitalLettersShouldNotInvokeTruncatedViewScripts()
 {
     $this->request->setModuleName('default')->setControllerName('Controller')->setActionName('Action');
     $controller = new Bar_IndexController($this->request, $this->response, array());
     $this->helper->setActionController($controller);
     $scriptName = $this->helper->getViewScript();
     $this->assertEquals('controller/action.phtml', $scriptName);
 }
开发者ID:ThorstenSuckow,项目名称:conjoon,代码行数:11,代码来源:ViewRendererTest.php

示例2: testViewScriptNameDoesNotIncludeDisallowedCharacters

 /**
  * @group ZF-10725
  * @dataProvider providerViewScriptNameDoesNotIncludeDisallowedCharacters
  */
 public function testViewScriptNameDoesNotIncludeDisallowedCharacters($actionName)
 {
     $this->request->setModuleName('default')->setControllerName('foo')->setActionName($actionName);
     $controller = new Bar_IndexController($this->request, $this->response, array());
     $this->helper->setActionController($controller);
     $scriptName = $this->helper->getViewScript();
     $this->assertEquals('foo/my-bar.phtml', $scriptName);
 }
开发者ID:htecvc2x,项目名称:htecvc2x-zf-training,代码行数:12,代码来源:ViewRendererTest.php

示例3: testStockInflectorWorksWithDottedRequestParts

 /**
  * @see ZF-2738
  */
 public function testStockInflectorWorksWithDottedRequestParts()
 {
     $this->request->setModuleName('foo')->setControllerName('car.bar')->setActionName('baz');
     $controller = new Bar_IndexController($this->request, $this->response, array());
     $this->helper->setActionController($controller);
     $viewScriptPaths = $this->helper->view->getAllPaths();
     $expectedPathRegex = '#modules/foo/views/scripts/$#';
     $this->assertRegExp($expectedPathRegex, $this->_normalizePath($viewScriptPaths['script'][0]));
     $this->assertEquals('car-bar/baz.phtml', $this->helper->getViewScript());
 }
开发者ID:SustainableCoastlines,项目名称:loveyourwater,代码行数:13,代码来源:ViewRendererTest.php

示例4: testPostDispatchDoesNothingOnRedirect

 public function testPostDispatchDoesNothingOnRedirect()
 {
     $this->request->setModuleName('bar')->setControllerName('index')->setActionName('test')->setDispatched(true);
     $this->response->setHttpResponseCode(302);
     $controller = new Bar_IndexController($this->request, $this->response, array());
     $this->helper->setActionController($controller);
     $this->helper->postDispatch();
     $content = $this->response->getBody();
     $this->assertNotContains('Rendered index/test.phtml in bar module', $content);
     $this->assertTrue(empty($content));
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:11,代码来源:ViewRendererTest.php

示例5: testPredispatchWithTwigTemplateEngine

 public function testPredispatchWithTwigTemplateEngine()
 {
     $this->request->setModuleName('foo')->setControllerName('index')->setActionName('bar');
     $controller = new Foo_IndexController($this->request, $this->response, array());
     $this->helper->setActionController($controller);
     $view = new Ano_View();
     $engine = new Ano_View_Engine_PhpEngine($view);
     $view->addTemplateEngine('twig', $engine);
     $this->helper->setView($view);
     $this->helper->preDispatch();
     $this->assertSame($engine, $this->helper->view->getTemplateEngine());
 }
开发者ID:niborb,项目名称:Ano_ZFTwig,代码行数:12,代码来源:ViewRendererTest.php

示例6: testRenderNormalizationIsCorrect

 public function testRenderNormalizationIsCorrect()
 {
     $this->request->setModuleName('default')->setControllerName('foo')->setActionName('myBar');
     $controller = new Bar_IndexController($this->request, $this->response, array());
     $this->helper->setActionController($controller);
     $scriptName = $this->helper->getViewScript();
     $this->assertEquals('foo/mybar.phtml', $scriptName);
     $this->request->setModuleName('default')->setControllerName('foo')->setActionName('baz__bat');
     $scriptName = $this->helper->getViewScript();
     $this->assertEquals('foo/baz-bat.phtml', $scriptName);
     $this->request->setModuleName('default')->setControllerName('Foo_Bar')->setActionName('bar__baz');
     $scriptName = $this->helper->getViewScript();
     $this->assertEquals('foo/bar/bar-baz.phtml', $scriptName);
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:14,代码来源:ViewRendererTest.php

示例7: testStockInflectorWorksWithViewBaseSpec

    /**
     * @issue ZF-2443
     */
    public function testStockInflectorWorksWithViewBaseSpec()
    {
        $this->request->setModuleName('bar')  // bar must exist so the ViewRendere doesnt throw an exception
                      ->setControllerName('index')
                      ->setActionName('admin');
        $controller = new Bar_IndexController($this->request, $this->response, array());
        $this->helper->setActionController($controller);
                      
        $this->helper->setView($view = new Zend_View());
        $this->helper->setViewBasePathSpec(':moduleDir/:module');
        $this->helper->initView();
        
        $viewScriptPaths = $view->getAllPaths(); 

        $this->assertRegExp('#modules/bar/bar/scripts/$#', $viewScriptPaths['script'][0]);
        $this->assertEquals($this->helper->getViewScript(), 'index/admin.phtml');
    }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:20,代码来源:ViewRendererTest.php


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