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


PHP ViewFactory::getView方法代码示例

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


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

示例1: getView

 /**
  * Returns the view to display.
  * 
  * @return string
  * @todo select view instance based on controller name
  */
 public function getView($controllerName, $result)
 {
     // On redirect, load default view object and tell it to redirect.
     if (isset($this->redirects[$controllerName][$result])) {
         $view = $this->viewFactory->getView();
         $view->setRedirect($this->redirects[$controllerName][$result]);
         return $view;
     }
     // If no view script is configured, we don't know what to do.
     if (!isset($this->views[$controllerName][$result])) {
         throw new Exception('Controller "' . $controllerName . '" result "' . $result . '" has no view script');
     }
     // Get the "real" view object (depending on the view script).
     $view = $this->viewFactory->getView($this->views[$controllerName][$result]);
     return $view;
 }
开发者ID:huanganxin,项目名称:MVC,代码行数:22,代码来源:ApplicationController.php

示例2: indexAction

 public function indexAction()
 {
     /* Once upon a time $shapes was extracted from $_REQUEST and successfully validated.
      *   And now $shapes is array like this:
      *   $shapes = [
      *       ['type' => 'circle', 'params' => [...]],
      *       ['type' => 'circle', 'params' => [...]]
      *   ];
      *
      *   We believe in it.
      */
     $shapes = Request::getShapes();
     $shapes = new ShapesCollection($shapes);
     $view = ViewFactory::getView(Request::getViewType());
     while ($shape = $shapes->getShape()) {
         $view->assignShape($shape);
     }
     $view->render();
 }
开发者ID:alexandryurchenko,项目名称:yelltest,代码行数:19,代码来源:indexController.php

示例3: testDefaultMapperCanBeConstructed

 /**
  * @covers ViewFactory::getView
  */
 public function testDefaultMapperCanBeConstructed()
 {
     $viewFactory = new ViewFactory();
     $this->assertInstanceOf('StdClass', $viewFactory->getView('StdClass', new Request(), new Response()));
 }
开发者ID:le-toan-mulodo,项目名称:bankaccount,代码行数:8,代码来源:ViewFactoryTest.php


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