0

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.

1 Answer 1

3

You have a typo... I guess you mean $this->time (without the $ in time).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.