我在实时服务器上有codeigniter项目,但我无法使用模板加载视图,这是代码:
$this->template->load('Template', 'view_admin');
这是库:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Template {
var $template_data = array();
function set($name, $value)
{
$this->template_data[$name] = $value;
}
function load($template = '', $view = '' , $view_data = array(), $return = FALSE)
{
$this->CI =& get_instance();
$this->set('contents', $this->CI->load->view($view, $view_data, TRUE));
return $this->CI->load->view($template, $this->template_data, $return);
}
}
/* End of file Template.php */
/* Location: ./system/application/libraries/Template.php */
我已经在自动加载文件中调用了库
$autoload['libraries'] = array('session', 'database', 'template');
但结果只是空白页,什么也不显示
在我进入实时服务器之前,它已经可以在本地主机上正常工作了。
那么,我错过了什么?谢谢进阶