本文整理汇总了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);
}