Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ModuleGrid.php
Go to the documentation of this file.
1 <?php
8 
10 
14 class ModuleGrid extends \Zend\Mvc\Controller\AbstractActionController
15 {
21  private $gridModule;
22 
26  public function __construct(
27  Grid\Module $gridModule
28  ) {
29  $this->gridModule = $gridModule;
30  }
31 
37  public function indexAction()
38  {
39  $view = new \Zend\View\Model\ViewModel();
40  $view->setTerminal(true);
41  return $view;
42  }
43 
50  public function modulesAction()
51  {
52  $moduleList = $this->gridModule->getList();
53 
54  return new \Zend\View\Model\JsonModel(
55  [
56  'success' => true,
57  'modules' => $moduleList,
58  'total' => count($moduleList),
59  ]
60  );
61  }
62 }
__construct(Grid\Module $gridModule)
Definition: ModuleGrid.php:26