只是为了一些背景我使用codeigniter与模板火花.
所以在我的控制器中我有以下功能
public function information()
{
$this->load->library('session');
$developer_id = $this->session->userdata('developer_id');
$this->load->model("Developer_model");
$information = $this->Developer_model->get_developer($developer_id);
$this->template->set('information', (array) $information);
$this->template->build('dashboard/information');
}
Run Code Online (Sandbox Code Playgroud)
在我看来,我是这样回应的
<?php echo $information['email']; ?>
Run Code Online (Sandbox Code Playgroud)
由于某种原因,我回来了"消息:未定义的索引:电子邮件"
这是我的第一个问题,所以希望我不清楚,但基本上我从我的数据库获取$信息并试图回显电子邮件,这只是一系列项目中的一件事.
当我var_dump $信息时,我得到以下内容:
object(stdClass)#21 (2) { ["timestamp"]=> int(1353444880991) ["result"]=> object(stdClass)#22 (3) { ["email"]=> string(21) "anothertest@gmail.com" ["api_key"]=> string(64) "de0f57acfc018882841b3255e89da11cb238160e84a66fe5b45bda8c51137c72" } }
Run Code Online (Sandbox Code Playgroud)
在此之前感谢您的帮助,只有在使用codeigniter 2个月之前我才真正完成了除了一些非常小的html废话之外的编码.所以对我来说很容易= D
归档时间: |
|
查看次数: |
6042 次 |
最近记录: |