toli4ilot
(Tortol)
1
hi guys!
It seems very easy but…
It gives error ‘class ‘orders’ cannot be found’ when I try to do so:
$value = 'orders';
$model = $value::findOne($id);
I guess in Yii 1.1 it works perfectly, isn’t it?
Thank you in advance
ksetrin
(Epv01)
2
Use namespace like a
$value = ‘app\models\Order’;
$model = $value::findOne(1);
rugabarbo
(Pavel Ivanov)
3
$value = Orders::classname();
toli4ilot
(Tortol)
4
I feel so shamed thank you much Ksetrin, I swear I felt it should be very easy - thanks again!
rugabarbo
(Pavel Ivanov)
5
tolich, you can also use ::classname() function as I showed above (;