Reputation: 9765
In yii framework helloworld, I defined a variable in controller class
class MessageController extends Controller
{
public $time = 'ok';
Supposely I could reference the variable $time
in relevant view class using $this->$time
.
But I am seeing variable undefined error.
Anything I might be missing.
Thanks.
Upvotes: 0
Views: 1226
Reputation: 223
You have a typo... I guess you mean $this->time (without the $ in time).
Upvotes: 3