Skip to content

Commit c9058d1

Browse files
committed
Use page result instead of rendering layout directly in controller actions
1 parent 1e9377a commit c9058d1

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

app/code/Magento/Backup/Controller/Adminhtml/Index/Grid.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@
66
*/
77
namespace Magento\Backup\Controller\Adminhtml\Index;
88

9+
use Magento\Framework\Controller\ResultFactory;
10+
911
class Grid extends \Magento\Backup\Controller\Adminhtml\Index
1012
{
1113
/**
1214
* Backup list action
1315
*
14-
* @return void
16+
* @return \Magento\Framework\Controller\ResultInterface
1517
*/
1618
public function execute()
1719
{
18-
$this->_view->loadLayout();
19-
$this->_view->renderLayout();
20+
return $this->resultFactory->create(ResultFactory::TYPE_PAGE);
2021
}
2122
}

app/code/Magento/CatalogSearch/Controller/Advanced/Index.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66
*/
77
namespace Magento\CatalogSearch\Controller\Advanced;
88

9+
use Magento\Framework\Controller\ResultFactory;
10+
911
class Index extends \Magento\Framework\App\Action\Action
1012
{
1113
/**
12-
* @return void
14+
* @return \Magento\Framework\Controller\ResultInterface
1315
*/
1416
public function execute()
1517
{
16-
$this->_view->loadLayout();
17-
$this->_view->renderLayout();
18+
return $this->resultFactory->create(ResultFactory::TYPE_PAGE);
1819
}
1920
}

app/code/Magento/Contact/Controller/Index/Index.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@
66
*/
77
namespace Magento\Contact\Controller\Index;
88

9+
use Magento\Framework\Controller\ResultFactory;
10+
911
class Index extends \Magento\Contact\Controller\Index
1012
{
1113
/**
1214
* Show Contact Us page
1315
*
14-
* @return void
16+
* @return \Magento\Framework\Controller\ResultInterface
1517
*/
1618
public function execute()
1719
{
18-
$this->_view->loadLayout();
19-
$this->_view->renderLayout();
20+
return $this->resultFactory->create(ResultFactory::TYPE_PAGE);
2021
}
2122
}

app/code/Magento/User/Controller/Adminhtml/User/Role/Editrolegrid.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@
66
*/
77
namespace Magento\User\Controller\Adminhtml\User\Role;
88

9+
use Magento\Framework\Controller\ResultFactory;
10+
911
class Editrolegrid extends \Magento\User\Controller\Adminhtml\User\Role
1012
{
1113
/**
1214
* Action for ajax request from assigned users grid
1315
*
14-
* @return void
16+
* @return \Magento\Framework\Controller\ResultInterface
1517
*/
1618
public function execute()
1719
{
18-
$this->_view->loadLayout();
19-
$this->_view->renderLayout();
20+
return $this->resultFactory->create(ResultFactory::TYPE_PAGE);
2021
}
2122
}

0 commit comments

Comments
 (0)