M
M
Mikha Pankratov2015-12-25 08:45:15
Yii
Mikha Pankratov, 2015-12-25 08:45:15

How to use scenario for attributeLabel?

Good afternoon,
I can’t find something, how can I use the scenario for the label attribute?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sunrails, 2015-12-25
@frmax

public function attributeLabels()
{
    switch($this->getScenario())
    {
        case 'case1':
            $labels = []; // набор 1
            break;
        case 'case2':
            $labels = []; // набор 2
            break;
        default:
            $labels = []; // набор по умолчанию
    }
    return $labels;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question