當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。