當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Controller::render方法代碼示例

本文整理匯總了PHP中Symfony\Bundle\FrameworkBundle\Controller\Controller::render方法的典型用法代碼示例。如果您正苦於以下問題:PHP Controller::render方法的具體用法?PHP Controller::render怎麽用?PHP Controller::render使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Symfony\Bundle\FrameworkBundle\Controller\Controller的用法示例。


在下文中一共展示了Controller::render方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: render

 /**
  * {@inheritdoc}
  */
 public function render($view, array $parameters = array(), Response $response = null)
 {
     $parameters['admin'] = isset($parameters['admin']) ? $parameters['admin'] : $this->admin;
     $parameters['base_template'] = isset($parameters['base_template']) ? $parameters['base_template'] : $this->getBaseTemplate();
     $parameters['admin_pool'] = $this->get('sonata.admin.pool');
     return parent::render($view, $parameters, $response);
 }
開發者ID:robhunt3r,項目名稱:SonataAdminBundle,代碼行數:10,代碼來源:CRUDController.php

示例2: render

 /**
  * {@inheritdoc}
  */
 protected function render($view, array $parameters = [], Response $response = null)
 {
     $pool = $this->get('sonata.admin.pool');
     $parameters['admin_pool'] = isset($parameters['admin_pool']) ? $parameters['admin_pool'] : $pool;
     $parameters['base_template'] = 'YnloAdminBundle::standard_layout.html.twig';
     return parent::render($view, $parameters, $response);
 }
開發者ID:ynloultratech,項目名稱:framework,代碼行數:10,代碼來源:StandaloneAdminController.php

示例3: render

 public function render($view, array $parameters = array(), Response $response = null)
 {
     if ($this->get('templating')->exists(self::BUNDLE_MAXIMCMS . ':' . $view)) {
         return parent::render(self::BUNDLE_MAXIMCMS . ':' . $view, $parameters);
     } else {
         return parent::render($this->bundle . ':' . $view, $parameters);
     }
 }
開發者ID:c4d3r,項目名稱:mcsuite-application-eyeofender,代碼行數:8,代碼來源:ModuleController.php

示例4: render

 public function render($template, array $data = array(), Response $response = null)
 {
     $lastTale = $this->getDoctrine()->getManager()->getRepository('AppBundle:Tale')->findLastPublicTale();
     $bestTale = $this->getDoctrine()->getManager()->getRepository('AppBundle:Tale')->findByLikesDesc();
     $correctTale = $this->getDoctrine()->getManager()->getRepository('AppBundle:Tale')->findByScoreDesc();
     $commonData = array('bestTale' => $bestTale, 'lastTale' => $lastTale[0], 'correctTale' => $correctTale[0]);
     return parent::render($template, $data + $commonData, $response);
 }
開發者ID:MonicaCiuchetti,項目名稱:ProgettoOpenness,代碼行數:8,代碼來源:BaseController.php

示例5: render

 public function render($view, array $parameters = array(), Response $response = null)
 {
     if (array_key_exists("pageTitle", $parameters)) {
         $this->twigParams = $parameters['pageTile'] . " | " . $this->twigParams['pageTitle'];
         unset($parameters['pageTitle']);
     }
     $this->twigParams = array_merge($this->twigParams, $parameters);
     return parent::render($view, $this->twigParams, $response);
 }
開發者ID:RLC85,項目名稱:compBundle,代碼行數:9,代碼來源:WebsiteController.php

示例6: render

 public function render($view, array $parameters = array(), Response $response = null)
 {
     if (isset($this->options['viewPrefix'])) {
         $view = $this->options['viewPrefix'] . $view;
     }
     if (isset($this->options['viewSuffix'])) {
         $view = $view . $this->options['viewSuffix'];
     }
     return parent::render($view, $parameters, $response);
 }
開發者ID:xsolve-pl,項目名稱:xs-newsletter,代碼行數:10,代碼來源:BaseController.php

示例7: render

 /**
  * {@inheritdoc}
  */
 public function render($view, array $parameters = array(), Response $response = null)
 {
     if (!$this->isXmlHttpRequest()) {
         $parameters['breadcrumbs_builder'] = $this->get('sonata.admin.breadcrumbs_builder');
     }
     $parameters['admin'] = isset($parameters['admin']) ? $parameters['admin'] : $this->admin;
     $parameters['base_template'] = isset($parameters['base_template']) ? $parameters['base_template'] : $this->getBaseTemplate();
     $parameters['admin_pool'] = $this->get('sonata.admin.pool');
     return parent::render($view, $parameters, $response);
 }
開發者ID:ejkun,項目名稱:SonataAdminBundle,代碼行數:13,代碼來源:CRUDController.php

示例8: onController

 public function onController(Controller $controller, Request $request)
 {
     $repos = $this->admin->getRepository();
     $dql = $this->admin->getListDQL();
     $em = $this->admin->getManager();
     $query = $em->createQuery($dql);
     $paginator = $this->admin->getService('knp_paginator');
     $pagination = $paginator->paginate($query, $this->page_number, 10, array('pageParameterName' => 'admin_list_page'));
     return $controller->render($this->template, array('sf_admin_loader' => $controller->get('sf.admin.loader'), 'admin' => $this->admin, 'action' => $this, 'pagination' => $pagination));
 }
開發者ID:symforce,項目名稱:symforce-admin,代碼行數:10,代碼來源:ListActionCache.php

示例9: onController

 public function onController(Controller $controller, Request $request)
 {
     $object = $this->admin->getRouteObject();
     $label = null;
     if ($this->admin->tree && $this->admin->getTreeObjectId()) {
         $label = $this->admin->trans('sf.tree.create.title', array('%object%' => $this->admin->string($this->admin->getTreeObject()), '%admin%' => $this->admin->getLabel()), $this->sf_domain);
     } else {
         $label = $this->admin->getFormLabel();
     }
     return $controller->render($this->template, array('sf_admin_loader' => $controller->get('sf.admin.loader'), 'admin' => $this->admin, 'action' => $this, 'object' => $object, 'title' => $label));
 }
開發者ID:symforce,項目名稱:symforce-admin,代碼行數:11,代碼來源:ViewActionCache.php

示例10: render

 /**
  * Renders a view with an handled Reponse
  * @see \Symfony\Bundle\FrameworkBundle\Controller\Controller::render()
  */
 public function render($view, array $parameters = array(), Response $response = null)
 {
     $response = parent::render($view, $parameters, $response);
     // get current request via the request_stack service
     $currentRequest = null;
     if ($this->requestStack instanceof RequestStack) {
         $currentRequest = $this->requestStack->getCurrentRequest();
     }
     foreach ($this->responseHandlers as $responseHandler) {
         if ($currentRequest !== null) {
             // give the current request to each response handler
             $responseHandler->setCurrentRequest($currentRequest);
         }
         $response = $responseHandler->handleResponse($response);
     }
     return $response;
 }
開發者ID:kmelia,項目名稱:fresh-symfony,代碼行數:21,代碼來源:AbstractKmeliaController.php

示例11: render

 public function render($view, array $parameters = array(), Response $response = null)
 {
     if (!array_key_exists('project', $parameters)) {
         $parameters['project'] = $this->project;
     }
     return parent::render($view, $parameters, $response);
 }
開發者ID:koalamon,項目名稱:koalamonframeworkbundle,代碼行數:7,代碼來源:ProjectAwareController.php

示例12: render

 /**
  * {@inheritdoc}
  */
 public function render($view, array $parameters = array(), Response $response = null)
 {
     return parent::render($this->getViewPrefix() . $view, $parameters, $response);
 }
開發者ID:mikoweb,項目名稱:vsymfo-core,代碼行數:7,代碼來源:Controller.php

示例13: render

 /**
  * Renders a view.
  *
  * @param string   $view       The view name
  * @param array    $parameters An array of parameters to pass to the view
  * @param Response $response   A response instance
  *
  * @return Response A Response instance
  */
 public function render($view, array $parameters = [], Response $response = null)
 {
     $parameters = array_merge($this->viewParameters, $parameters);
     return parent::render($view, $parameters, $response);
 }
開發者ID:freedog96150,項目名稱:puphpet,代碼行數:14,代碼來源:ControllerAbstract.php

示例14: render

 /**
  * Overridding the default render function to include the customer list with each page.
  *
  * @param string   $view
  * @param array    $params
  * @param Response $response
  *
  * @return Response
  */
 public function render($view, array $params = array(), Response $response = NULL)
 {
     $aircraftHelper = $this->get('group3_a.aircrew_helper');
     $params['aircrews'] = $aircraftHelper->getAllAircrews();
     $params['active'] = @$params['active'] ?: 0;
     return parent::render($view, $params, $response);
 }
開發者ID:troussos,項目名稱:IT490,代碼行數:16,代碼來源:AircrewController.php

示例15: render

 public function render($view, array $parameters = array(), Response $response = null)
 {
     return parent::render($view, $parameters, $response);
 }
開發者ID:symfony,項目名稱:symfony,代碼行數:4,代碼來源:ControllerTest.php


注:本文中的Symfony\Bundle\FrameworkBundle\Controller\Controller::render方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。