简体   繁体   中英

Phalcon 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

I'm not familiar with Phalcon but I think you need to do:

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

And use:

{{ email }}

Or

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

And use:

{{ tbl_user.email }} 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM