コード例 #1
0
 public function testSetPath()
 {
     $path = 'test/path';
     $params = ['one' => 1, 'two' => 2];
     $this->redirectInterface->expects($this->once())->method('updatePathParams')->with($params)->will($this->returnValue($params));
     $this->assertInstanceOf('Magento\\Framework\\Controller\\Result\\Redirect', $this->redirect->setPath($path, $params));
 }
コード例 #2
0
ファイル: Banner.php プロジェクト: Doability/magento2dev
 /**
  * Get back result redirect after add/edit.
  *
  * @param \Magento\Framework\Controller\Result\Redirect $resultRedirect
  * @param null                                          $paramCrudId
  *
  * @return \Magento\Framework\Controller\Result\Redirect
  */
 protected function _getBackResultRedirect(\Magento\Framework\Controller\Result\Redirect $resultRedirect, $paramCrudId = null)
 {
     switch ($this->getRequest()->getParam('back')) {
         case 'edit':
             $resultRedirect->setPath('*/*/edit', [static::PARAM_CRUD_ID => $paramCrudId, '_current' => true, 'store' => $this->getRequest()->getParam('store'), 'current_slider_id' => $this->getRequest()->getParam('current_slider_id'), 'saveandclose' => $this->getRequest()->getParam('saveandclose')]);
             break;
         case 'new':
             $resultRedirect->setPath('*/*/new', ['_current' => true]);
             break;
         default:
             $resultRedirect->setPath('*/*/');
     }
     return $resultRedirect;
 }
コード例 #3
0
 /**
  * {@inheritdoc}
  */
 public function setPath($path, array $params = array())
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'setPath');
     if (!$pluginInfo) {
         return parent::setPath($path, $params);
     } else {
         return $this->___callPlugins('setPath', func_get_args(), $pluginInfo);
     }
 }