G
G
Grag2014-03-10 16:14:13
Yii
Grag, 2014-03-10 16:14:13

Yii, how to make the notation more compact?

I want an entry like this:

$this->createAction('account_data_CUD')->run();
$this->createAction('security_data_CUD')->run();
$this->createAction('work_data_CUD')->run();

make it a little more compact.
Is there a way?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2014-03-10
@Grag

except like this:

foreach (['account_data_CUD', 'security_data_CUD', 'work_data_CUD' as $action) {
    $this->createAction($action)->run();
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question