Answer the question
In order to leave comments, you need to log in
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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question