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


PHP Page::create方法代码示例

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


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

示例1: execute

 /**
  * Blog Index, shows a list of recent blog posts.
  *
  * @return \Magento\Framework\View\Result\PageFactory
  */
 public function execute()
 {
     /** @var \Magento\Backend\Model\View\Result\Page $resultPage */
     $resultPage = $this->resultPageFactory->create();
     $resultPage->getConfig()->getTitle()->prepend(__('Store locations'));
     return $resultPage;
 }
开发者ID:ant-workaholic,项目名称:Store-locator,代码行数:12,代码来源:Index.php

示例2: execute

 /**
  * Blog Index, shows a list of recent blog posts.
  *
  * @return \Magento\Framework\View\Result\PageFactory
  */
 public function execute()
 {
     //$post_id = $this->getRequest()->getParam('post_id', $this->getRequest()->getParam('id', false));
     $user_id = $this->getRequest()->getParam('user_id', false);
     $survey_id = $this->getRequest()->getParam('survey_id', false);
     $resultPage = $this->resultPageFactory->create();
     // We can add our own custom page handles for layout easily.
     //$resultPage->addHandle('surevey_view_index');
     if ($survey_id !== false) {
         $this->_survey->load($survey_id);
     } else {
         $this->_survey->load(1);
     }
     //$shippingInfoModel = $this->_shippingInfoFactory->create()->loadByHash($this->getRequest()->getParam('hash'));
     $this->_coreRegistry->register('current_survey', $this->_survey);
     $this->_coreRegistry->register('current_survey_user', $user_id);
     //echo $this->_survey->getName();
     // This will generate a layout handle like: blog_post_view_id_1
     // giving us a unique handle to target specific blog posts if we wish to.
     //$this->_survey->getId()
     $resultPage->addPageLayoutHandles(['id' => $survey_id]);
     // /** @var \Ashsmith\Blog\Helper\Post $post_helper */
     // //$post_helper = $this->_objectManager->get('Ashsmith\Blog\Helper\Post');
     $result_page = $resultPage;
     //$post_helper->prepareResultPost($this, $post_id);
     if (!$result_page) {
         $resultForward = $this->resultForwardFactory->create();
         return $resultForward->forward('noroute');
     }
     return $result_page;
 }
开发者ID:uchenic,项目名称:magento2-module-survey,代码行数:36,代码来源:Index.php

示例3: execute

 /**
  * Blog Index, shows a list of recent blog posts.
  *
  * @return \Magento\Framework\View\Result\PageFactory
  */
 public function execute()
 {
     $this->_logger->addDebug('DDDDDDDDDDDDDDDDDDDDDDD');
     $this->_logger->addInfo('DDDDDDDDDDDDDDDDDDDDDDD');
     $resultPage = $this->resultPageFactory->create();
     $resultPage->getConfig()->getTitle()->prepend(__('TurboInternational_SetupEnvironment'));
     return $resultPage;
 }
开发者ID:kshakirov,项目名称:TurboInternational,代码行数:13,代码来源:index.php

示例4: execute

 /**
  * Show payment page
  * @return \Magento\Framework\View\Result\PageFactory
  */
 public function execute()
 {
     $result = $this->payment->createPaymentRequest();
     $resultPage = $this->resultPageFactory->create();
     $code = $result->getCode();
     $resultPage->getLayout()->getBlock('pagseguro.payment.checkout')->setCode($code);
     $resultPage->getLayout()->getBlock('pagseguro.payment.checkout')->setPaymentJs($this->getPagSeguroPaymentJs());
     $resultPage->getLayout()->getBlock('pagseguro.payment.checkout')->setPaymentUrl($this->payment->checkoutUrl($code, 'paymentService'));
     return $resultPage;
 }
开发者ID:pagseguro,项目名称:magento2,代码行数:14,代码来源:Checkout.php

示例5: execute

 /**
  * Show payment page
  * @return \Magento\Framework\View\Result\PageFactory
  */
 public function execute()
 {
     /** @var \Magento\Framework\View\Result\PageFactory $resultPage */
     $resultPage = $this->_resultPageFactory->create();
     if ($this->link()) {
         $resultPage->getLayout()->getBlock('pagseguro.payment.success')->setPaymentLink($this->link());
     }
     $resultPage->getLayout()->getBlock('pagseguro.payment.success')->setPaymentType($this->type());
     $resultPage->getLayout()->getBlock('pagseguro.payment.success')->setOrderId($this->order()->getIncrementId());
     $resultPage->getLayout()->getBlock('pagseguro.payment.success')->setCanViewOrder(true);
     $this->clearSession();
     return $resultPage;
 }
开发者ID:pagseguro,项目名称:magento2,代码行数:17,代码来源:Success.php

示例6: execute

 /**
  * Show payment page
  * @return \Magento\Framework\View\Result\PageFactory
  */
 public function execute()
 {
     $resultPage = $this->_resultPageFactory->create();
     $resultPage->getLayout()->getBlock('pagseguro.direct.payment')->setData('order', $this->_checkoutSession->getLastRealOrder()->getId());
     try {
         $this->_library->setEnvironment();
         $resultPage->getLayout()->getBlock('pagseguro.direct.payment')->setData('sessionCode', $this->_library->getSession());
         $resultPage->getLayout()->getBlock('pagseguro.direct.payment')->setData('paymentUrl', $this->_library->getDirectPaymentUrl());
     } catch (\Exception $exc) {
         /** @var \Magento\Sales\Model\Order $order */
         $order = $this->_objectManager->create('\\Magento\\Sales\\Model\\Order')->load($this->_checkoutSession->getLastRealOrder()->getId());
         /** change payment status in magento */
         $order->addStatusToHistory('pagseguro_cancelada', null, true);
         /** save order */
         $order->save();
         return $this->_redirect('pagseguro/payment/failure');
     }
     return $resultPage;
 }
开发者ID:pagseguro,项目名称:magento2,代码行数:23,代码来源:Payment.php

示例7: execute

 /**
  * Faq Index, shows a list of recent Faqs.
  *
  * @return \Magento\Framework\View\Result\PageFactory
  */
 public function execute()
 {
     return $this->resultPageFactory->create();
 }
开发者ID:TheFrankman,项目名称:magento2-faq,代码行数:9,代码来源:Index.php

示例8: execute

 public function execute()
 {
     $result = $this->resultPageFactory->create();
     $result->addHandle('algolia');
     return $result;
 }
开发者ID:algolia,项目名称:algoliasearch-magento-2,代码行数:6,代码来源:Index.php

示例9: execute

 /**
  * Testimonials Index, shows a list of recent testimonials.
  *
  * @return \Magento\Framework\View\Result\PageFactory
  */
 public function execute()
 {
     $resultPage = $this->resultPageFactory->create();
     $resultPage->getConfig()->getTitle()->prepend(__('V3N0m21 create testimonial'));
     return $resultPage;
 }
开发者ID:V3N0m21,项目名称:test-example,代码行数:11,代码来源:Index.php

示例10: __construct

 /**
  * Boleto payment constructor.
  * @param \Magento\Framework\App\Action\Context $context
  * @param \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory
  */
 public function __construct(\Magento\Framework\App\Action\Context $context, \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory)
 {
     parent::__construct($context);
     $this->resultJsonFactory = $resultJsonFactory;
     $this->result = $this->resultJsonFactory->create();
 }
开发者ID:pagseguro,项目名称:magento2,代码行数:11,代码来源:Boleto.php

示例11: execute

 /**
  * Blog Index, shows a list of recent blog posts.
  *
  * @return \Magento\Framework\View\Result\PageFactory
  */
 public function execute()
 {
     $resultPage = $this->resultPageFactory->create();
     $resultPage->getConfig()->getTitle()->prepend(__('Williams HelloWorld'));
     return $resultPage;
 }
开发者ID:wclabhinav,项目名称:Magento2,代码行数:11,代码来源:index.php


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