Grid.php 872 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. *
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. namespace Magento\Bundle\Controller\Adminhtml\Bundle\Selection;
  8. use Magento\Catalog\Controller\Adminhtml\Product;
  9. class Grid extends Product
  10. {
  11. /**
  12. * @return mixed
  13. */
  14. public function execute()
  15. {
  16. $index = $this->getRequest()->getParam('index');
  17. if (!preg_match('/^[a-z0-9_.]*$/i', $index)) {
  18. throw new \InvalidArgumentException('Invalid parameter "index"');
  19. }
  20. return $this->getResponse()->setBody(
  21. $this->_view->getLayout()->createBlock(
  22. \Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Bundle\Option\Search\Grid::class,
  23. 'adminhtml.catalog.product.edit.tab.bundle.option.search.grid'
  24. )->setIndex($index)->toHtml()
  25. );
  26. }
  27. }