本文整理汇总了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);
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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));
}
示例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));
}
示例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;
}
示例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);
}
示例12: render
/**
* {@inheritdoc}
*/
public function render($view, array $parameters = array(), Response $response = null)
{
return parent::render($this->getViewPrefix() . $view, $parameters, $response);
}
示例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);
}
示例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);
}
示例15: render
public function render($view, array $parameters = array(), Response $response = null)
{
return parent::render($view, $parameters, $response);
}