Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
All Data Structures Namespaces Files Functions Variables Pages
Generic.php
Go to the documentation of this file.
1 <?php
7 
9 {
13  protected $_shippingFedex;
14 
20  protected $_code = '';
21 
25  public function __construct(\Magento\Fedex\Model\Carrier $shippingFedex)
26  {
27  $this->_shippingFedex = $shippingFedex;
28  }
29 
35  public function toOptionArray()
36  {
37  $configData = $this->_shippingFedex->getCode($this->_code);
38  $arr = [];
39  foreach ($configData as $code => $title) {
40  $arr[] = ['value' => $code, 'label' => $title];
41  }
42  return $arr;
43  }
44 }
$title
Definition: default.phtml:14
__construct(\Magento\Fedex\Model\Carrier $shippingFedex)
Definition: Generic.php:25
$code
Definition: info.phtml:12