简体   繁体   English

Phalcon未定义变量

[英]Phalcon Undefined variable

I am new to phalcon framework. 我是Phalcon框架的新手。 I have set the variable email in my TblUserController's edit action as 我在TblUserController的edit动作中将变量email设置为

$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 / edit.volt中,我这样写:

{{ tbl_user.email }} 

but it gives error 但它给出了错误

Undefined variable: tbl_user 未定义的变量:tbl_user

I'm not familiar with Phalcon but I think you need to do: 我对Phalcon不熟悉,但我认为您需要这样做:

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

And use: 并使用:

{{ email }}

Or 要么

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

And use: 并使用:

{{ tbl_user.email }} 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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