yii2 - instantiate model class from variable

yii2
voted: 0
vote
yii2 model

yii2 - instantiate model class from variable

<?php
    $model = 'apple';
    $modelName = "/app/model/" . + ucfirst($model);
    $model = new $modelName();
?>
working url: not entered
version: 2
Leave a Comment:
Characters left:
No comments yet.