Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
GetShippingItemsGrid.php
Go to the documentation of this file.
1 <?php
8 
11 
13 {
19  const ADMIN_RESOURCE = 'Magento_Sales::shipment';
20 
24  protected $shipmentLoader;
25 
30  public function __construct(
31  Action\Context $context,
32  \Magento\Shipping\Controller\Adminhtml\Order\ShipmentLoader $shipmentLoader
33  ) {
34  $this->shipmentLoader = $shipmentLoader;
35  parent::__construct($context);
36  }
37 
43  public function execute()
44  {
45  $this->shipmentLoader->setOrderId($this->getRequest()->getParam('order_id'));
46  $this->shipmentLoader->setShipmentId($this->getRequest()->getParam('shipment_id'));
47  $this->shipmentLoader->setShipment($this->getRequest()->getParam('shipment'));
48  $this->shipmentLoader->setTracking($this->getRequest()->getParam('tracking'));
49  $this->shipmentLoader->load();
50  return $this->getResponse()->setBody(
51  $this->_view->getLayout()->createBlock(
52  \Magento\Shipping\Block\Adminhtml\Order\Packaging\Grid::class
53  )->setIndex(
54  $this->getRequest()->getParam('index')
55  )->toHtml()
56  );
57  }
58 }
__construct(Action\Context $context, \Magento\Shipping\Controller\Adminhtml\Order\ShipmentLoader $shipmentLoader)