我的控制器功能: function view_story($ story_id)
{
$this->load->model('m_signup');
$data['template_data'] = $this->m_signup->get_template($story_id);
var_dump($data);
// here i want 'template_name' so that it can save in variable.
}
我的输出
array (size=1)
'template_data' =>
array (size=1)
0 =>
array (size=3)
'bg_image' => string 'assets/img/marine/bubbles1.png'
'bg_sound' => string 'assets/img/old/old.mp3' (length=22)
'template_name' => string 'Marine' (length=6)
答案 0 :(得分:1)
你想要这样尝试......
function view_story($story_id)
{
$this->load->model('m_signup');
$template_data= $this->m_signup->get_template($story_id)->result_array();
print_r($template_data);
}