當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BlockContextInterface::getSettings方法代碼示例

本文整理匯總了PHP中Sonata\BlockBundle\Block\BlockContextInterface::getSettings方法的典型用法代碼示例。如果您正苦於以下問題:PHP BlockContextInterface::getSettings方法的具體用法?PHP BlockContextInterface::getSettings怎麽用?PHP BlockContextInterface::getSettings使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Sonata\BlockBundle\Block\BlockContextInterface的用法示例。


在下文中一共展示了BlockContextInterface::getSettings方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: execute

 /**
  * {@inheritdoc}
  */
 public function execute(BlockContextInterface $blockContext, Response $response = null)
 {
     $context = $blockContext->getBlock()->getSetting('context');
     $criteria = array('mode' => $blockContext->getSetting('mode'), 'context' => $context);
     $order = array($blockContext->getSetting('order') => $blockContext->getSetting('sort'));
     return $this->renderResponse($blockContext->getTemplate(), array('context' => $blockContext, 'settings' => $blockContext->getSettings(), 'block' => $blockContext->getBlock(), 'pager' => $this->galleryManager->getPager($criteria, 1, $blockContext->getSetting('number'), $order)), $response);
 }
開發者ID:nicolasricci,項目名稱:SonataMediaBundle,代碼行數:10,代碼來源:GalleryListBlockService.php

示例2: execute

 /**
  * {@inheritdoc}
  */
 public function execute(BlockContextInterface $blockContext, Response $response = null)
 {
     $criteria = array();
     if ('admin' !== $blockContext->getSetting('mode')) {
         $criteria['customer'] = $this->customerManager->findOneBy(array('user' => $this->securityContext->getToken()->getUser()));
     }
     return $this->renderPrivateResponse($blockContext->getTemplate(), array('context' => $blockContext, 'settings' => $blockContext->getSettings(), 'block' => $blockContext->getBlock(), 'orders' => $this->orderManager->findBy($criteria, array('createdAt' => 'DESC'), $blockContext->getSetting('number'))), $response);
 }
開發者ID:johnulist,項目名稱:ecommerce-1,代碼行數:11,代碼來源:RecentOrdersBlockService.php

示例3: 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

示例4: execute

 /**
  * {@inheritdoc}
  */
 public function execute(BlockContextInterface $blockContext, Response $response = null)
 {
     // $settings = array_merge($this->getDefaultSettings(), $blockContext->getSettings());
     $myentityrepository = $this->em->getRepository('TNCYSchoolBundle:ExerciceResult');
     $query = $this->em->createQueryBuilder()->select('exerciceResult')->from('TNCYSchoolBundle:ExerciceResult', 'exerciceResult')->leftJoin('TNCYSchoolBundle:Homework', 'homework', 'WITH', 'exerciceResult.homework = homework')->where('exerciceResult.homework = :h')->setParameter('h', $blockContext->getSettings()['homeworkId'])->getQuery();
     $results = $query->getResult();
     return $this->renderResponse($blockContext->getTemplate(), array('block' => $blockContext->getBlock(), 'settings' => $blockContext->getSettings(), 'results' => $results), $response);
 }
開發者ID:FlorianKromer,項目名稱:TNCY-English,代碼行數:11,代碼來源:HomeworkBlockService.php

示例5: 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

示例6: execute

 /**
  * {@inheritdoc}
  */
 public function execute(BlockContextInterface $blockContext, Response $response = null)
 {
     $settings = $blockContext->getSettings();
     $object = null;
     if ($object != null) {
         $template = $blockContext->getTemplate();
     } else {
         $template = 'DNTMBundle:Block:empty.html.twig';
     }
     return $this->renderResponse($template, array('object' => $object, 'block' => $blockContext->getBlock(), 'settings' => $blockContext->getSettings()), $response);
 }
開發者ID:kozmon,項目名稱:teachme,代碼行數:14,代碼來源:ProductSearchBlockService.php

示例7: execute

 /**
  * {@inheritdoc}
  */
 public function execute(BlockContextInterface $blockContext, Response $response = null)
 {
     $settings = $blockContext->getSettings();
     $content = $this->container->get('dn.tm.manager.page_block')->getContentForBlock($settings['block'], $settings['blockFilters']);
     $object = null;
     if ($content != null && $content['object'] != null && count($content['object']) > 0) {
         $object = $content['object'][0];
     }
     if ($object != null) {
         $template = $blockContext->getTemplate();
     } else {
         $template = 'DNTMBundle:Block:empty.html.twig';
     }
     return $this->renderResponse($template, array('object' => $object, 'block' => $blockContext->getBlock(), 'settings' => $blockContext->getSettings()), $response);
 }
開發者ID:kozmon,項目名稱:teachme,代碼行數:18,代碼來源:VideoBlockService.php

示例8: execute

 /**
  * {@inheritdoc}
  */
 public function execute(BlockContextInterface $blockContext, Response $response = null)
 {
     $settings = $blockContext->getSettings();
     $form = $this->getForm();
     $formSaveSuccess = false;
     if ($settings['request'] != null) {
         $request = $settings['request'];
         $form->handleRequest($request);
         if ($form->isValid()) {
             $formSaveSuccess = $this->em->getRepository('DNTMBundle:CustomFormData')->saveForm($form->getData(), $this->getName());
         }
     }
     $template = $blockContext->getTemplate();
     return $this->renderResponse($template, array('form' => $form->createView(), 'formSaveSuccess' => $formSaveSuccess, 'block' => $blockContext->getBlock(), 'settings' => $blockContext->getSettings()), $response);
 }
開發者ID:kozmon,項目名稱:teachme,代碼行數:18,代碼來源:NewsletterBlockService.php

示例9: execute

 /**
  * Render the block
  *
  * @param BlockContextInterface $blockContext
  * @param Response $response
  */
 public function execute(BlockContextInterface $blockContext, Response $response = null)
 {
     // merge settings
     $settings = $blockContext->getSettings();
     $teachers = $this->entityManager->getRepository('AppBundle:Teacher')->findAll();
     return $this->renderResponse($blockContext->getTemplate(), array('teachers' => $teachers, 'block' => $blockContext->getBlock(), 'settings' => $settings), $response);
 }
開發者ID:kongr45gpen,項目名稱:myclass,代碼行數:13,代碼來源:TeacherScheduleBlock.php

示例10: execute

 /**
  * {@inheritdoc}
  */
 public function execute(BlockContextInterface $blockContext, Response $response = null)
 {
     // merge settings
     $settings = $blockContext->getSettings();
     $milestones = $this->service->getUpcomingMilestones(array('limit' => $settings['limit']));
     return $this->renderResponse($blockContext->getTemplate(), array('milestones' => $milestones, 'block' => $blockContext->getBlock(), 'settings' => $settings), $response);
 }
開發者ID:CampaignChain,項目名稱:core,代碼行數:10,代碼來源:MilestoneUpcomingListGroupBlockService.php

示例11: execute

 public function execute(BlockContextInterface $blockContext, Response $response = null)
 {
     $settings = $blockContext->getSettings();
     $repository = $this->em->getRepository('KinkinwebLhvbBundle:Gallery');
     $galleries = $repository->getLatest($settings['number']);
     return $this->renderResponse($blockContext->getTemplate(), array('galleries' => $galleries, 'block' => $blockContext->getBlock(), 'settings' => $settings), $response);
 }
開發者ID:kinkinweb,項目名稱:lhvb,代碼行數:7,代碼來源:RecentGalleryBlockService.php

示例12: execute

 public function execute(BlockContextInterface $blockContext, Response $response = null)
 {
     // merge settings
     $settings = $blockContext->getSettings();
     $hotCourses = \CourseManager::returnHotCourses();
     return $this->renderResponse($blockContext->getTemplate(), array('hot_courses' => $hotCourses, 'block' => $blockContext->getBlock(), 'settings' => $settings), $response);
 }
開發者ID:par-orillonsoft,項目名稱:chamilo-lms,代碼行數:7,代碼來源:CourseBlockService.php

示例13: execute

 /**
  * {@inheritdoc}
  */
 public function execute(BlockContextInterface $blockContext, Response $response = null)
 {
     $user_current = $this->securityContext->getToken()->getUser();
     $user_id = $user_current->getId();
     // Tenues stats
     $tenues = $this->em->getRepository('IuchBundle:Tenue')->findAll();
     $nbr_tenues = 0;
     foreach ($tenues as $tenue) {
         $nbr_tenues += $tenue->getNombreDonne();
     }
     // Cles stats
     $cles = $this->em->getRepository('IuchBundle:Cle')->findAll();
     $nbr_cles = 0;
     foreach ($cles as $cle) {
         if ($cle->getRemis() == true) {
             $nbr_cles++;
         }
     }
     // Badges stats
     $badges = $this->em->getRepository('IuchBundle:Badge')->findAll();
     $nbr_badges = 0;
     foreach ($badges as $badge) {
         if ($badge->getRemis() == true) {
             $nbr_badges++;
         }
     }
     return $this->renderResponse($blockContext->getTemplate(), array('block' => $blockContext->getBlock(), 'base_template' => $this->pool->getTemplate('IuchBundle:Block:statuser.html.twig'), 'settings' => $blockContext->getSettings(), 'tenues' => $nbr_tenues, 'cles' => $nbr_cles, 'badges' => $nbr_badges), $response);
 }
開發者ID:luciemannechez,項目名稱:projet-intranet_hopital,代碼行數:31,代碼來源:StatUserBlockService.php

示例14: execute

 public function execute(BlockContextInterface $blockContext, Response $response = null)
 {
     $schoolID = $this->session->get('tsk_school_id');
     $orgID = $this->session->get('tsk_organization_id');
     $em = $this->entityManager;
     $sc = $this->securityContext;
     $erpContext = new \TSK\UserBundle\Form\Model\ErpContext();
     if ($orgID) {
         $organization = $em->getRepository('TSKUserBundle:Organization')->find($orgID);
         $erpContext->setOrganization($organization);
     }
     if ($schoolID) {
         $school = $em->getRepository('TSKSchoolBundle:School')->find($schoolID);
         $erpContext->setSchool($school);
     }
     $isSuperAdmin = false;
     foreach ($sc->getToken()->getRoles() as $role) {
         if ($role->getRole() == 'ROLE_SUPER_ADMIN') {
             $isSuperAdmin = true;
         }
     }
     if ($isSuperAdmin) {
         // Create form
         $form = $this->formFactory->create(new \TSK\UserBundle\Form\Type\AdminErpContextType($em, $sc), $erpContext);
     } else {
         // Determine if user has more than one school ...
         // Create form
         $form = $this->formFactory->create(new \TSK\UserBundle\Form\Type\UserErpContextType($em, $sc), $erpContext);
     }
     return $this->renderResponse($blockContext->getTemplate(), array('block' => $blockContext->getBlock(), 'form' => $form->createView(), 'isSuperAdmin' => $isSuperAdmin, 'settings' => $blockContext->getSettings()), $response);
 }
開發者ID:sgh1986915,項目名稱:symfony-tsk,代碼行數:31,代碼來源:ErpContextSwitcherBlockService.php

示例15: execute

 public function execute(BlockContextInterface $blockContext, Response $response = null)
 {
     $qb = $this->em->createQueryBuilder()->select('t')->from('AldorPortfolioBundle:Technology', 't');
     $entities = $qb->getQuery()->getResult();
     $settings = $blockContext->getSettings();
     return $this->renderResponse($blockContext->getTemplate(), array('tags' => $entities, 'title' => $settings['title'], 'ribbon' => $settings['ribbon']), $response);
 }
開發者ID:Aldor007,項目名稱:mkaciuba.pl,代碼行數:7,代碼來源:TechnologiesBlockService.php


注:本文中的Sonata\BlockBundle\Block\BlockContextInterface::getSettings方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。