S
S
Sergey2015-12-10 10:52:58
Yii
Sergey, 2015-12-10 10:52:58

Is it possible to call a trait dynamically?

class PatchController extends Controller{
    public function actionIndex($name, $method){
        //Как мне здесь подключить трейт "$name" и вызвать в нем метод "$method" ?
    }
    private function log($msg){
        echo($msg);
    }
}

trait Test{
    public function test(){
        $this->log('ok');
    }
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Kravchenko, 2015-12-10
@mydearfriend

No.

E
Evgeny Svirsky, 2015-12-10
@e_svirsky

stackoverflow.com/questions/14355029/is-it-possible...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question