render() protected method

Renders a view.
protected render ( string $view, array $parameters = [], Response $response = null ) : Response
$view string The view name
$parameters array An array of parameters to pass to the view
$response Symfony\Component\HttpFoundation\Response A response instance
return Symfony\Component\HttpFoundation\Response A Response instance
Ejemplo n.º 1
0
 /**
  * {@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);
 }
 /**
  * {@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);
 }
 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);
     }
 }
 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);
 }
Ejemplo n.º 5
0
 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);
 }
Ejemplo n.º 6
0
 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);
 }
Ejemplo n.º 7
0
 /**
  * {@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);
 }
Ejemplo n.º 8
0
 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));
 }
Ejemplo n.º 9
0
 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));
 }
 /**
  * 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;
 }
 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);
 }
Ejemplo n.º 12
0
 /**
  * {@inheritdoc}
  */
 public function render($view, array $parameters = array(), Response $response = null)
 {
     return parent::render($this->getViewPrefix() . $view, $parameters, $response);
 }
Ejemplo n.º 13
0
 /**
  * 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);
 }
Ejemplo n.º 14
0
 /**
  * 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);
 }
Ejemplo n.º 15
0
 public function render($view, array $parameters = array(), Response $response = null)
 {
     return parent::render($view, $parameters, $response);
 }
Ejemplo n.º 16
0
 /**
  * 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 = array(), Response $response = null)
 {
     $parameters = $this->decorateTranslator($parameters);
     return parent::render($view, $parameters, $response);
 }
Ejemplo n.º 17
0
 public function testRenderTemplating()
 {
     $templating = $this->getMock('Symfony\\Bundle\\FrameworkBundle\\Templating\\EngineInterface');
     $templating->expects($this->once())->method('renderResponse')->willReturn(new Response('bar'));
     $container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerInterface');
     $container->expects($this->at(0))->method('has')->willReturn(true);
     $container->expects($this->at(1))->method('get')->will($this->returnValue($templating));
     $controller = new Controller();
     $controller->setContainer($container);
     $this->assertEquals('bar', $controller->render('foo')->getContent());
 }
 /**
  * {@inheritdoc}
  */
 public function render($view, array $parameters = [], Response $response = null)
 {
     return parent::render($view, $this->getTemplateAttributes($parameters), $response);
 }
Ejemplo n.º 19
0
 /**
  * Overridding the default render function to include the order 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)
 {
     /**
      * @var OrderHelper
      */
     $orderHelper = $this->get('group3_a.order_helper');
     if (!empty($params['startDate']) || !empty($params['stopDate'])) {
         $params['orders'] = $orderHelper->getOrderBetweenDates($params['startDate'], $params['stopDate']);
     } else {
         $params['orders'] = $orderHelper->getAllOrders();
     }
     $params['active'] = @$params['active'] ?: 0;
     return parent::render($view, $params, $response);
 }
 /**
  * @param string   $view
  * @param array    $parameters
  * @param Response $response
  *
  * @return Response
  */
 public function render($view, array $parameters = array(), Response $response = null)
 {
     $parameters['base_template'] = isset($parameters['base_template']) ? $parameters['base_template'] : $this->container->getParameter('sensi.yamlgui.base_template');
     $parameters['admin_pool'] = $this->get('sonata.admin.pool');
     return parent::render($view, $parameters);
 }
Ejemplo n.º 21
0
 public function render($view, array $parameters = array(), \Symfony\Component\HttpFoundation\Response $response = null)
 {
     $response = parent::render($view, $parameters, $response);
     return $response;
 }
Ejemplo n.º 22
0
 public function render($view, array $parameters = array(), Response $response = null)
 {
     if (!isset($parameters['searchForm'])) {
         $parameters['searchForm'] = $this->createSearchForm()->createView();
     }
     return parent::render($view, $parameters, $response);
 }
Ejemplo n.º 23
0
 /**
  * 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)
 {
     $flightHelper = $this->get('group3_a.flight_helper');
     $params['flights'] = $flightHelper->getAllFlights();
     $params['active'] = @$params['active'] ?: 0;
     return parent::render($view, $params, $response);
 }
Ejemplo n.º 24
0
 public function render($view, array $params = array(), Response $response = null)
 {
     $name = str_replace('Controller', ':', get_called_class());
     $name = str_replace('\\', null, $name);
     return parent::render("{$name}{$view}.html.twig", $params, $response);
 }
 public function render($template, array $params = array(), \Symfony\Component\HttpFoundation\Response $response = NULL)
 {
     $params['pages'] = $this->pages;
     return parent::render($template, $params);
 }
 /**
  * merges siteData variables with the parameters array, 
  * checks for required values 
  * then calls parent render
  **/
 public function render($view, array $parameters = array(), Response $response = null)
 {
     $parameters = array_merge($this->getSiteData(), $parameters);
     $this->containsRequiredData($parameters, true);
     if (strpos($view, "::") === 0) {
         $view = $this->getBundleName() . substr($view, 1);
     }
     return parent::render($view, $parameters, $response);
 }
Ejemplo n.º 27
0
 public function render($view, array $parameters = array(), \Symfony\Component\HttpFoundation\Response $response = null)
 {
     $event = new \SKCMS\FrontBundle\Event\PreRenderEvent($this->getRequest());
     $this->get('event_dispatcher')->dispatch(\SKCMS\FrontBundle\Event\SKCMSFrontEvents::PRE_RENDER, $event);
     return parent::render($view, $parameters, $response);
 }
Ejemplo n.º 28
0
 /**
  * Overridding the default render function to include the item 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)
 {
     /**
      * @var ItemHelper
      */
     $itemHelper = $this->get('group3_a.item_helper');
     $params['items'] = $itemHelper->getAllItems();
     $params['active'] = @$params['active'] ?: 0;
     return parent::render($view, $params, $response);
 }
Ejemplo n.º 29
0
 protected function render($view, array $parameters = array(), Response $response = null)
 {
     if (strpos($view, ':') === false) {
         $view = 'AppBundle::' . $view;
     }
     $parameters['lang'] = $this->getTranslator()->getLocale();
     $parameters['module'] = $this;
     return parent::render($view, $parameters, $response);
 }
Ejemplo n.º 30
0
 /**
  * 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)
 {
     $customerHelper = $this->get('group3_a.customer_helper');
     $params['customers'] = $customerHelper->getAllCustomers();
     $params['active'] = @$params['active'] ?: 0;
     return parent::render($view, $params, $response);
 }