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


PHP Application::render方法代码示例

本文整理汇总了PHP中Eccube\Application::render方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::render方法的具体用法?PHP Application::render怎么用?PHP Application::render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Eccube\Application的用法示例。


在下文中一共展示了Application::render方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: download

 /**
  * 作成ボタンクリック時の処理
  * 帳票のPDFをダウンロードする
  *
  * @param Application $app
  * @param Request $request
  * @throws BadRequestHttpException
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function download(Application $app, Request $request)
 {
     // POSTでない場合は終了する
     if ('POST' !== $request->getMethod()) {
         throw new BadRequestHttpException();
     }
     $form = $app['form.factory']->createBuilder('admin_order_pdf')->getForm();
     $form->handleRequest($request);
     // validation
     if (!$form->isValid()) {
         return $app->render('OrderPdf/View/admin/order_pdf.twig', array('form' => $form->createView()));
     }
     // サービスの取得
     $service = $app['eccube.plugin.order_pdf.service.order_pdf'];
     // 購入情報からPDFを作成する
     $status = $service->makePdf($form->getData());
     // 異常終了した場合の処理
     if (!$status) {
         $service->close();
         $app->addError('admin.order_pdf.download.failure', 'admin');
         return $app->render('OrderPdf/View/admin/order_pdf.twig', array('form' => $form->createView()));
     }
     // ダウンロードする
     $response = new Response($service->outputPdf(), 200, array('content-type' => 'application/pdf'));
     // レスポンスヘッダーにContent-Dispositionをセットし、ファイル名をreceipt.pdfに指定
     $response->headers->set('Content-Disposition', 'attachment; filename="' . $service->getPdfFileName() . '"');
     return $response;
 }
开发者ID:k-yamamura,项目名称:order-pdf-plugin,代码行数:37,代码来源:OrderPdfController.php

示例2: index

 public function index(Application $app, Request $request)
 {
     $form = $app['form.factory']->createBuilder('plugin_Uzaitaikai_mypage_question')->getForm();
     if ('POST' === $request->getMethod()) {
         $form->handleRequest($request);
         if ($form->isValid()) {
             $Question = $form['question']->getData();
             return $app->render('Uzaitaikai/Resource/template/mypage/withdraw_complete.twig', array('form' => $form->createView(), 'Question' => $Question));
         }
     }
     return $app->render('Uzaitaikai/Resource/template/mypage/withdraw.twig', array('form' => $form->createView()));
 }
开发者ID:chihiro-adachi,项目名称:eccube3-uzaitaikai-plugin,代码行数:12,代码来源:WithdrawController.php

示例3: searchProduct

 /**
  * 商品検索画面を表示する
  * @param Application $app
  * @param Request $request
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function searchProduct(Application $app, Request $request)
 {
     if ($request->isXmlHttpRequest()) {
         $app['monolog']->addDebug('search product start.');
         $searchData = array('name' => $request->get('id'));
         if ($categoryId = $request->get('category_id')) {
             $Category = $app['eccube.repository.category']->find($categoryId);
             $searchData['category_id'] = $Category;
         }
         /** @var $Products \Eccube\Entity\Product[] */
         $qb = $app['eccube.repository.product']->getQueryBuilderBySearchData($searchData);
         // 除外するproduct_idを設定する
         $existProductId = $request->get('exist_product_id');
         if (strlen($existProductId > 0)) {
             $qb->andWhere($qb->expr()->notin('p.id', ':existProductId'))->setParameter('existProductId', explode(",", $existProductId));
         }
         $Products = $qb->getQuery()->getResult();
         if (is_null($Products)) {
             $app['monolog']->addDebug('search product not found.');
         }
         $forms = array();
         foreach ($Products as $Product) {
             /* @var $builder \Symfony\Component\Form\FormBuilderInterface */
             $builder = $app['form.factory']->createNamedBuilder('', 'add_cart', null, array('product' => $Product));
             $addCartForm = $builder->getForm();
             $forms[$Product->getId()] = $addCartForm->createView();
         }
         return $app->render('Recommend/View/admin/search_product.twig', array('forms' => $forms, 'Products' => $Products));
     }
 }
开发者ID:sai-ken-tanaka,项目名称:recommend_plugin,代码行数:36,代码来源:RecommendSearchModelController.php

示例4: index

 public function index(Application $app, Request $request)
 {
     $email = $request->cookies->get('email');
     /* @var $form \Symfony\Component\Form\FormInterface */
     $form = $app['form.factory']->createNamedBuilder('', 'customer_login')->getForm();
     return $app->render('Block/login.twig', array('error' => $app['security.last_error']($request), 'email' => $email, 'form' => $form->createView()));
 }
开发者ID:hiroyasu55,项目名称:ec-cube,代码行数:7,代码来源:LoginController.php

示例5: index

 public function index(Application $app, Request $request, $id = null)
 {
     $Mail = null;
     if ($id) {
         $Mail = $app['orm.em']->getRepository('\\Eccube\\Entity\\MailTemplate')->find($id);
         if (is_null($Mail)) {
             throw new NotFoundHttpException();
         }
     }
     $builder = $app['form.factory']->createBuilder('mail', $Mail);
     $event = new EventArgs(array('builder' => $builder, 'Mail' => $Mail), $request);
     $app['eccube.event.dispatcher']->dispatch(EccubeEvents::ADMIN_SETTING_SHOP_MAIL_INDEX_INITIALIZE, $event);
     $form = $builder->getForm();
     $form['template']->setData($Mail);
     if ('POST' === $request->getMethod()) {
         $form->handleRequest($request);
         // 新規登録は現時点では未実装とする.
         if (is_null($Mail)) {
             $app->addError('admin.shop.mail.save.error', 'admin');
             return $app->redirect($app->url('admin_setting_shop_mail'));
         }
         if ($form->isValid()) {
             $app['orm.em']->flush();
             $event = new EventArgs(array('form' => $form, 'Mail' => $Mail), $request);
             $app['eccube.event.dispatcher']->dispatch(EccubeEvents::ADMIN_SETTING_SHOP_MAIL_INDEX_COMPLETE, $event);
             $app->addSuccess('admin.shop.mail.save.complete', 'admin');
             return $app->redirect($app->url('admin_setting_shop_mail_edit', array('id' => $id)));
         }
     }
     return $app->render('Setting/Shop/mail.twig', array('form' => $form->createView(), 'id' => $id));
 }
开发者ID:ec-cube,项目名称:ec-cube,代码行数:31,代码来源:MailController.php

示例6: index

 public function index(Application $app, Request $request, $id)
 {
     $repos = $app['eccube.plugin.holiday.repository.holidayweek'];
     $TargetHolidayWeek = new \Plugin\Holiday\Entity\HolidayWeek();
     if ($id) {
         $TargetHolidayWeek = $repos->find($id);
         if (!$TargetHolidayWeek) {
             throw new NotFoundHttpException();
         }
         $TargetHolidayWeek->week = unserialize($TargetHolidayWeek->week);
     }
     $form = $app['form.factory']->createBuilder('admin_holiday_week', $TargetHolidayWeek)->getForm();
     if ('POST' === $request->getMethod()) {
         $form->handleRequest($request);
         if ($form->isValid()) {
             // 取得した曜日選択情報をシリアライズ
             $TargetHolidayWeek->week = serialize($TargetHolidayWeek->week);
             $status = $repos->save($TargetHolidayWeek);
             if ($status) {
                 $app->addSuccess('admin.holiday.save.complete', 'admin');
                 return $app->redirect($app->url('admin_holiday_week'));
             } else {
                 $app->addError('admin.holiday.save.error', 'admin');
             }
         }
     }
     return $app->render('Holiday/View/admin/week.twig', array('form' => $form->createView(), 'TargetHolidayWeek' => $TargetHolidayWeek));
 }
开发者ID:ActiveFusions,项目名称:Holiday,代码行数:28,代码来源:HolidayWeekController.php

示例7: index

 public function index(Application $app, Request $request)
 {
     $builder = $app['form.factory']->createBuilder('admin_cache');
     $form = $builder->getForm();
     $form->handleRequest($request);
     if ($form->isSubmitted() && $form->isValid()) {
         $data = $form->get('cache')->getData();
         $cacheDir = $app['config']['root_dir'] . '/app/cache';
         $filesystem = new Filesystem();
         foreach ($data as $dir) {
             if (is_dir($cacheDir . '/' . $dir)) {
                 // 指定されたキャッシュディレクトリを削除
                 $finder = Finder::create()->in($cacheDir . '/' . $dir);
                 $filesystem->remove($finder);
             }
             if ($dir == 'doctrine') {
                 // doctrineが指定された場合は, cache driver経由で削除.
                 $config = $app['orm.em']->getConfiguration();
                 $this->deleteDoctrineCache($config->getMetadataCacheImpl());
                 $this->deleteDoctrineCache($config->getQueryCacheImpl());
                 $this->deleteDoctrineCache($config->getResultCacheImpl());
                 $this->deleteDoctrineCache($config->getHydrationCacheImpl());
             }
         }
         $app->addSuccess('admin.content.cache.save.complete', 'admin');
     }
     return $app->render('Content/cache.twig', array('form' => $form->createView()));
 }
开发者ID:ec-cube,项目名称:ec-cube,代码行数:28,代码来源:CacheController.php

示例8: index

 public function index(Application $app, Request $request, $id = null)
 {
     $Mail = null;
     if ($id) {
         $Mail = $app['orm.em']->getRepository('\\Eccube\\Entity\\MailTemplate')->find($id);
         if (is_null($Mail)) {
             throw new NotFoundHttpException();
         }
     }
     $form = $app['form.factory']->createBuilder('mail', $Mail)->getForm();
     $form['template']->setData($Mail);
     if ('POST' === $request->getMethod()) {
         $form->handleRequest($request);
         // 新規登録は現時点では未実装とする.
         if (is_null($Mail)) {
             $app->addError('admin.shop.mail.save.error', 'admin');
             return $app->redirect($app->url('admin_setting_shop_mail'));
         }
         if ($form->isValid()) {
             $app['orm.em']->flush();
             $app->addSuccess('admin.shop.mail.save.complete', 'admin');
             return $app->redirect($app->url('admin_setting_shop_mail_edit', array('id' => $id)));
         }
     }
     return $app->render('Setting/Shop/mail.twig', array('form' => $form->createView(), 'id' => $id));
 }
开发者ID:hiroyasu55,项目名称:ec-cube,代码行数:26,代码来源:MailController.php

示例9: index

 public function index(Application $app, Request $request, $class_name_id, $id = null)
 {
     //
     $ClassName = $app['eccube.repository.class_name']->find($class_name_id);
     if (!$ClassName) {
         throw new NotFoundHttpException();
     }
     if ($id) {
         $TargetClassCategory = $app['eccube.repository.class_category']->find($id);
         if (!$TargetClassCategory || $TargetClassCategory->getClassName() != $ClassName) {
             throw new NotFoundHttpException();
         }
     } else {
         $TargetClassCategory = new \Eccube\Entity\ClassCategory();
         $TargetClassCategory->setClassName($ClassName);
     }
     //
     $form = $app['form.factory']->createBuilder('admin_class_category', $TargetClassCategory)->getForm();
     if ($request->getMethod() === 'POST') {
         $form->handleRequest($request);
         if ($form->isValid()) {
             $status = $app['eccube.repository.class_category']->save($TargetClassCategory);
             if ($status) {
                 $app->addSuccess('admin.class_category.save.complete', 'admin');
                 return $app->redirect($app->url('admin_product_class_category', array('class_name_id' => $ClassName->getId())));
             } else {
                 $app->addError('admin.class_category.save.error', 'admin');
             }
         }
     }
     $ClassCategories = $app['eccube.repository.class_category']->getList($ClassName);
     return $app->render('Product/class_category.twig', array('form' => $form->createView(), 'ClassName' => $ClassName, 'ClassCategories' => $ClassCategories, 'TargetClassCategory' => $TargetClassCategory));
 }
开发者ID:nahaichuan,项目名称:ec-cube,代码行数:33,代码来源:ClassCategoryController.php

示例10: index

 public function index(Application $app)
 {
     $DeviceType = $app['eccube.repository.master.device_type']->find(DeviceType::DEVICE_TYPE_PC);
     // 登録されているブロック一覧の取得
     $Blocks = $app['eccube.repository.block']->getList($DeviceType);
     return $app->render('Content/block.twig', array('Blocks' => $Blocks));
 }
开发者ID:geany-y,项目名称:LikeNiko,代码行数:7,代码来源:BlockController.php

示例11: edit

 /**
  * edit
  *
  * @param  Application $app
  * @request  Symfony\Component\HttpFoundation\Request $app
  * @return mixed
  */
 public function edit(Application $app, Request $request, $id = null)
 {
     $Customer = $app['user'];
     // 配送先住所最大値判定
     // $idが存在する際は、追加処理ではなく、編集の処理ため本ロジックスキップ
     if (is_null($id)) {
         $addressCurrNum = count($Customer->getCustomerAddresses());
         $addressMax = $app['config']['deliv_addr_max'];
         if ($addressCurrNum >= $addressMax) {
             throw new NotFoundHttpException();
         }
     }
     $CustomerAddress = $app['eccube.repository.customer_address']->findOrCreateByCustomerAndId($Customer, $id);
     $parentPage = $request->get('parent_page', null);
     // 正しい遷移かをチェック
     $allowdParents = array($app->url('mypage_delivery'), $app->url('shopping_delivery'));
     // 遷移が正しくない場合、デフォルトであるマイページの配送先追加の画面を設定する
     if (!in_array($parentPage, $allowdParents)) {
         $parentPage = $app->url('mypage_delivery');
     }
     /* @var $form \Symfony\Component\Form\FormInterface */
     $form = $app['form.factory']->createBuilder('customer_address', $CustomerAddress)->getForm();
     if ($request->getMethod() === 'POST') {
         $form->handleRequest($request);
         if ($form->isValid()) {
             $app['orm.em']->persist($CustomerAddress);
             $app['orm.em']->flush();
             $app->addSuccess('mypage.delivery.add.complete');
             return $app->redirect($app->url('mypage_delivery'));
         }
     }
     $BaseInfo = $app['eccube.repository.base_info']->get();
     return $app->render('Mypage/delivery_edit.twig', array('form' => $form->createView(), 'parentPage' => $parentPage, 'BaseInfo' => $BaseInfo));
 }
开发者ID:haou1945,项目名称:ec-cube,代码行数:41,代码来源:DeliveryController.php

示例12: edit

 /**
  * edit
  *
  * @param  Application $app
  * @request  Symfony\Component\HttpFoundation\Request $app
  * @return mixed
  */
 public function edit(Application $app, Request $request, $id = null)
 {
     $Customer = $app['user'];
     $CustomerAddress = $app['eccube.repository.customer_address']->findOrCreateByCustomerAndId($Customer, $id);
     $parentPage = $request->get('parent_page', null);
     // 正しい遷移かをチェック
     $allowdParents = array($app->url('mypage_delivery'), $app->url('shopping_delivery'));
     // 遷移が正しくない場合、デフォルトであるマイページの配送先追加の画面を設定する
     if (!in_array($parentPage, $allowdParents)) {
         $parentPage = $app->url('mypage_delivery');
     }
     /* @var $form \Symfony\Component\Form\FormInterface */
     $form = $app['form.factory']->createBuilder('customer_address', $CustomerAddress)->getForm();
     if ($request->getMethod() === 'POST') {
         $form->handleRequest($request);
         if ($form->isValid()) {
             $app['orm.em']->persist($CustomerAddress);
             $app['orm.em']->flush();
             $app->addSuccess('mypage.delivery.add.complete');
             return $app->redirect($app->url('mypage_delivery'));
         }
     }
     $BaseInfo = $app['eccube.repository.base_info']->get();
     return $app->render('Mypage/delivery_edit.twig', array('form' => $form->createView(), 'parentPage' => $parentPage, 'BaseInfo' => $BaseInfo));
 }
开发者ID:nanasess,项目名称:nagoya-eccube-study,代码行数:32,代码来源:DeliveryController.php

示例13: index

 public function index(Application $app, Request $request, $id)
 {
     $repos = $app['eccube.plugin.holiday.repository.holiday'];
     $TargetHoliday = new \Plugin\Holiday\Entity\Holiday();
     if ($id) {
         $TargetHoliday = $repos->find($id);
         if (!$TargetHoliday) {
             throw new NotFoundHttpException();
         }
     }
     $form = $app['form.factory']->createBuilder('admin_holiday', $TargetHoliday)->getForm();
     if ('POST' === $request->getMethod()) {
         $form->handleRequest($request);
         if ($form->isValid()) {
             $status = $repos->save($TargetHoliday);
             if ($status) {
                 $app->addSuccess('admin.holiday.save.complete', 'admin');
                 return $app->redirect($app->url('admin_holiday'));
             } else {
                 $app->addError('admin.holiday.save.error', 'admin');
             }
         }
     }
     $Holidays = $app['eccube.plugin.holiday.repository.holiday']->findAll();
     return $app->render('Holiday/View/admin/holiday.twig', array('form' => $form->createView(), 'Holidays' => $Holidays, 'TargetHoliday' => $TargetHoliday));
 }
开发者ID:ActiveFusions,项目名称:Holiday,代码行数:26,代码来源:HolidayController.php

示例14: index

 public function index(Application $app, Request $request, $id = null)
 {
     if ($id) {
         $TargetClassName = $app['eccube.repository.class_name']->find($id);
         if (!$TargetClassName) {
             throw new NotFoundHttpException();
         }
     } else {
         $TargetClassName = new \Eccube\Entity\ClassName();
     }
     $builder = $app['form.factory']->createBuilder('admin_class_name', $TargetClassName);
     $event = new EventArgs(array('builder' => $builder, 'TargetClassName' => $TargetClassName), $request);
     $app['eccube.event.dispatcher']->dispatch(EccubeEvents::ADMIN_PRODUCT_CLASS_NAME_INDEX_INITIALIZE, $event);
     $form = $builder->getForm();
     if ($request->getMethod() === 'POST') {
         $form->handleRequest($request);
         if ($form->isValid()) {
             $status = $app['eccube.repository.class_name']->save($TargetClassName);
             if ($status) {
                 $event = new EventArgs(array('form' => $form, 'TargetClassName' => $TargetClassName), $request);
                 $app['eccube.event.dispatcher']->dispatch(EccubeEvents::ADMIN_PRODUCT_CLASS_NAME_INDEX_COMPLETE, $event);
                 $app->addSuccess('admin.class_name.save.complete', 'admin');
                 return $app->redirect($app->url('admin_product_class_name'));
             } else {
                 $app->addError('admin.class_name.save.error', 'admin');
             }
         }
     }
     $ClassNames = $app['eccube.repository.class_name']->getList();
     return $app->render('Product/class_name.twig', array('form' => $form->createView(), 'ClassNames' => $ClassNames, 'TargetClassName' => $TargetClassName));
 }
开发者ID:shhirose,项目名称:ec-cube,代码行数:31,代码来源:ClassNameController.php

示例15: index

 /**
  * 税率設定の初期表示・登録
  *
  * @param Application $app
  * @param Request $request
  * @param null $id
  * @return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
  */
 public function index(Application $app, Request $request, $id = null)
 {
     $TargetTaxRule = null;
     if ($id == null) {
         $TargetTaxRule = $app['eccube.repository.tax_rule']->newTaxRule();
     } else {
         $TargetTaxRule = $app['eccube.repository.tax_rule']->find($id);
         if (is_null($TargetTaxRule)) {
             throw new NotFoundHttpException();
         }
     }
     /** @var  $BaseInfo \Eccube\Entity\BaseInfo */
     $BaseInfo = $app['eccube.repository.base_info']->get();
     $builder = $app['form.factory']->createBuilder('tax_rule', $TargetTaxRule);
     $builder->get('option_product_tax_rule')->setData($BaseInfo->getOptionProductTaxRule());
     if ($TargetTaxRule->isDefaultTaxRule()) {
         // 基本税率設定は適用日時の変更は行わない
         $builder = $builder->remove('apply_date');
     }
     /* @var $form \Symfony\Component\Form\FormInterface */
     $form = $builder->getForm();
     if ('POST' === $request->getMethod()) {
         $form->handleRequest($request);
         if ($this->isValid($app['orm.em'], $form)) {
             $app['orm.em']->persist($TargetTaxRule);
             $app['orm.em']->flush();
             $app->addSuccess('admin.shop.tax.save.complete', 'admin');
             return $app->redirect($app->url('admin_setting_shop_tax'));
         }
     }
     // 共通税率一覧
     $TaxRules = $app['eccube.repository.tax_rule']->getList();
     return $app->render('Setting/Shop/tax_rule.twig', array('TargetTaxRule' => $TargetTaxRule, 'TaxRules' => $TaxRules, 'form' => $form->createView()));
 }
开发者ID:hiroyasu55,项目名称:ec-cube,代码行数:42,代码来源:TaxRuleController.php


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