mirror of
https://github.com/yiisoft/yii2.git
synced 2026-03-13 02:37:38 +01:00
added panels position
This commit is contained in:
@@ -41,6 +41,10 @@ class Module extends \yii\base\Module
|
||||
* @var array|Panel[]
|
||||
*/
|
||||
public $panels = [];
|
||||
/**
|
||||
* @var string postion of the custom configured panels 'begin' or 'end'
|
||||
*/
|
||||
public $panelsPosition = 'end';
|
||||
/**
|
||||
* @var string the directory storing the debugger data files. This can be specified using a path alias.
|
||||
*/
|
||||
@@ -64,7 +68,15 @@ class Module extends \yii\base\Module
|
||||
Yii::$app->getView()->on(View::EVENT_END_BODY, [$this, 'renderToolbar']);
|
||||
});
|
||||
|
||||
$this->panels = ArrayHelper::merge($this->corePanels(), $this->panels);
|
||||
switch ($this->panelsPosition) {
|
||||
case 'begin':
|
||||
$this->panels = ArrayHelper::merge($this->panels, $this->corePanels());
|
||||
break;
|
||||
case 'end':
|
||||
default:
|
||||
$this->panels = ArrayHelper::merge($this->corePanels(), $this->panels);
|
||||
break;
|
||||
}
|
||||
foreach ($this->panels as $id => $config) {
|
||||
$config['module'] = $this;
|
||||
$config['id'] = $id;
|
||||
|
||||
Reference in New Issue
Block a user