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 
9 
13 class Generic implements GenericInterface
14 {
18  protected $carrierConfig;
19 
25  protected $_code = '';
26 
30  public function __construct(\Magento\Ups\Helper\Config $carrierConfig)
31  {
32  $this->carrierConfig = $carrierConfig;
33  }
34 
40  public function toOptionArray()
41  {
42  $configData = $this->carrierConfig->getCode($this->_code);
43  $arr = [];
44  foreach ($configData as $code => $title) {
45  $arr[] = ['value' => $code, 'label' => __($title)];
46  }
47  return $arr;
48  }
49 }
$title
Definition: default.phtml:14
__construct(\Magento\Ups\Helper\Config $carrierConfig)
Definition: Generic.php:30
__()
Definition: __.php:13
$code
Definition: info.phtml:12