for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Created for IG Monitoring.
* User: jakim <[email protected]>
* Date: 11.03.2018
*/
namespace app\modules\admin\models;
use app\dictionaries\TrackerType;
use yii\base\Model;
use yii\helpers\ArrayHelper;
class MonitoringForm extends Model
{
public $names;
public $tags;
public $proxy_id;
public $proxy_tag_id;
public function rules()
return [
['names', 'required'],
[['names', 'tags', 'proxy_id', 'proxy_tag_id'], 'safe'],
];
}
public function scenarios()
TrackerType::ACCOUNT => [
'names',
'tags', 'proxy_id', 'proxy_tag_id',
],
TrackerType::TAG => [
'proxy_id', 'proxy_tag_id',
public function attributeLabels()
$labels = parent::attributeLabels();
$trackerTypeLabels = [
'names' => 'Accounts',
'names' => 'Tags',
return ArrayHelper::merge($labels, ArrayHelper::getValue($trackerTypeLabels, $this->scenario, []));
public function attributeHints()
$hints = [
'names' => 'Comma separated list.',
$trackerTypeHints = [
TrackerType::ACCOUNT => [],
TrackerType::TAG => [],
return ArrayHelper::merge($hints, ArrayHelper::getValue($trackerTypeHints, $this->scenario, []));