本文整理匯總了PHP中Sonata\AdminBundle\Admin\Pool::getTemplate方法的典型用法代碼示例。如果您正苦於以下問題:PHP Pool::getTemplate方法的具體用法?PHP Pool::getTemplate怎麽用?PHP Pool::getTemplate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Sonata\AdminBundle\Admin\Pool
的用法示例。
在下文中一共展示了Pool::getTemplate方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: execute
/**
* {@inheritdoc}
*/
public function execute(BlockContextInterface $blockContext, Response $response = null)
{
$user_current = $this->securityContext->getToken()->getUser();
$info = $this->em->getRepository("ApplicationSonataUserBundle:Matching")->lastMatchingFromUser($user_current);
// merge settings
$settings = array_merge($this->getDefaultSettings(), $blockContext->getSettings());
return $this->renderResponse($blockContext->getTemplate(), array('block' => $blockContext->getBlock(), 'base_template' => $this->pool->getTemplate('layout'), 'info' => $info, 'settings' => $blockContext->getSettings()), $response);
}
示例2: execute
/**
* {@inheritdoc}
*/
public function execute(BlockContextInterface $blockContext, Response $response = null)
{
$user_current = $this->securityContext->getToken()->getUser();
$info['count_base'] = $this->em->getRepository("ApplicationSonataUserBundle:Base")->countConsumerBases($user_current);
$info['count_campaign'] = $this->em->getRepository("ApplicationSonataUserBundle:Campaign")->countActiveCampaign();
$info['count_md5'] = $this->em->getRepository("ApplicationSonataUserBundle:BaseDetail")->countBaseDetailByUser($user_current);
$info['count_match'] = $this->em->getRepository("ApplicationSonataUserBundle:MatchingDetail")->countMatchingDetailByUser($user_current);
// merge settings
$settings = array_merge($this->getDefaultSettings(), $blockContext->getSettings());
return $this->renderResponse($blockContext->getTemplate(), array('block' => $blockContext->getBlock(), 'base_template' => $this->pool->getTemplate('layout'), 'info' => $info, 'settings' => $blockContext->getSettings()), $response);
}
示例3: testTemplates
public function testTemplates()
{
$this->assertInternalType('array', $this->pool->getTemplates());
$this->pool->setTemplates(array('ajax' => 'Foo.html.twig'));
$this->assertNull($this->pool->getTemplate('bar'));
$this->assertEquals('Foo.html.twig', $this->pool->getTemplate('ajax'));
}
示例4: execute
/**
* {@inheritdoc}
*/
public function execute(BlockContextInterface $blockContext, Response $response = null)
{
// Totals stats
$tots = array('users' => $this->em->getRepository('ApplicationSonataUserBundle:User')->count(), 'children' => $this->em->getRepository('WCSCantineBundle:Eleve')->count(), 'meals' => $this->em->getRepository('WCSCantineBundle:Lunch')->count(), 'schools' => $this->em->getRepository('WCSCantineBundle:School')->count());
$options['date_day'] = $this->date_now_service->getDate();
$repoLunch = $this->em->getRepository('WCSCantineBundle:Lunch');
// stats lunch : current week
$options['enable_next_week'] = false;
$options['without_pork'] = true;
$currentWeekMealsNoPork = $repoLunch->getWeekMeals($options);
$options['without_pork'] = false;
$currentWeekMeals = $repoLunch->getWeekMeals($options);
// stats lunch : next week
$options['enable_next_week'] = true;
$options['without_pork'] = true;
$nextWeekMealsNoPork = $repoLunch->getWeekMeals($options);
$options['without_pork'] = false;
$nextWeekMeals = $repoLunch->getWeekMeals($options);
return $this->renderResponse($blockContext->getTemplate(), array('block' => $blockContext->getBlock(), 'base_template' => $this->pool->getTemplate('WCSCantineBundle:Block:stateleves.html.twig'), 'settings' => $blockContext->getSettings(), 'currentWeekMeals' => $currentWeekMeals, 'currentWeekMealsNoPork' => $currentWeekMealsNoPork, 'nextWeekMeals' => $nextWeekMeals, 'nextWeekMealsNoPork' => $nextWeekMealsNoPork, 'tots' => $tots), $response);
}
示例5: execute
/**
* {@inheritdoc}
*/
public function execute(BlockContextInterface $blockContext, Response $response = null)
{
// merge settings
$settings = array_merge($this->getDefaultSettings(), $blockContext->getSettings());
return $this->renderResponse($blockContext->getTemplate(), array('block' => $blockContext->getBlock(), 'base_template' => $this->pool->getTemplate('layout'), 'settings' => $blockContext->getSettings()), $response);
}