Total Complexity | 12 |
Total Lines | 64 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
12 | class LanguageDropdown extends Dropdown |
||
13 | { |
||
14 | private static $_labels; |
||
15 | |||
16 | private $_isError; |
||
17 | |||
18 | /** |
||
19 | * @inheritdoc |
||
20 | */ |
||
21 | public function init() |
||
22 | { |
||
23 | $route = Yii::$app->controller->route; |
||
24 | $params = $_GET; |
||
25 | $this->_isError = $route === Yii::$app->errorHandler->errorAction; |
||
26 | array_unshift($params, '/' . $route); |
||
27 | $this->renderLanguageItems(); |
||
28 | parent::init(); |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * @return string |
||
33 | */ |
||
34 | public function run() |
||
40 | } |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * @param $code |
||
45 | * @return mixed|null |
||
46 | */ |
||
47 | public static function label($code) |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * Render items language select |
||
60 | */ |
||
61 | public function renderLanguageItems() |
||
80 |