Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Generic.php
Go to the documentation of this file.
1 <?php
7 
8 class Generic
9 {
13  protected $_shippingDhl;
14 
18  protected $_code = '';
19 
23  public function __construct(\Magento\Dhl\Model\Carrier $shippingDhl)
24  {
25  $this->_shippingDhl = $shippingDhl;
26  }
27 
33  public function toOptionArray()
34  {
35  $configData = $this->_shippingDhl->getCode($this->_code);
36  $arr = [];
37  foreach ($configData as $code => $title) {
38  $arr[] = ['value' => $code, 'label' => $title];
39  }
40  return $arr;
41  }
42 }
$title
Definition: default.phtml:14
__construct(\Magento\Dhl\Model\Carrier $shippingDhl)
Definition: Generic.php:23
$code
Definition: info.phtml:12