当前位置: 首页>>代码示例>>PHP>>正文


PHP Pool::getTemplate方法代码示例

本文整理汇总了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);
 }
开发者ID:StanFrag,项目名称:CCM-Stage,代码行数:11,代码来源:LastMatchingBlockService.php

示例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);
 }
开发者ID:StanFrag,项目名称:CCM-Stage,代码行数:14,代码来源:UserInfoBlockService.php

示例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'));
 }
开发者ID:r1pp3rj4ck,项目名称:SonataAdminBundle,代码行数:7,代码来源:PoolTest.php

示例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);
 }
开发者ID:WildCodeSchool,项目名称:projet-gesty,代码行数:23,代码来源:StatElevesBlockService.php

示例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);
 }
开发者ID:StanFrag,项目名称:CCM-Stage,代码行数:9,代码来源:SoftStageBlockService.php


注:本文中的Sonata\AdminBundle\Admin\Pool::getTemplate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。