本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例7: execute
/**
* Faq Index, shows a list of recent Faqs.
*
* @return \Magento\Framework\View\Result\PageFactory
*/
public function execute()
{
return $this->resultPageFactory->create();
}
示例8: execute
public function execute()
{
$result = $this->resultPageFactory->create();
$result->addHandle('algolia');
return $result;
}
示例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;
}
示例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();
}
示例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;
}