We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Undefined variable

I am new to phalcon framework. I have set the variable email in my TblUserController's edit action as

$tbl_user = TblUser::findFirstByuser_id($user_id); $this->view->setVar("email", $tbl_user->email);

and in tbl_user/edit.volt I write like:

{{ tbl_user.email }}

but it gives error

Undefined variable: tbl_user


8.1k

You send to view variable by name email, and volt use this name

$this->view->setVar("email", $tbl_user->email);

...

{{ email }}