Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/226.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 带Smarty的Codeigniter导致错误_Php_Codeigniter_Smarty - Fatal编程技术网

Php 带Smarty的Codeigniter导致错误

Php 带Smarty的Codeigniter导致错误,php,codeigniter,smarty,Php,Codeigniter,Smarty,我使用的是Smarty_parser.php,当我单独使用解析器时,或者如果我运行解析器,然后调用视图时,它工作得很好。例如: public function act() { @$this->load->library('smarty_parser'); $data = array('Someinfo'); $this->smarty_parser->parse('contentTmpls/act.tpl', $data); // Load

我使用的是Smarty_parser.php,当我单独使用解析器时,或者如果我运行解析器,然后调用视图时,它工作得很好。例如:

public function act() {
    @$this->load->library('smarty_parser');
    $data = array('Someinfo');
    $this->smarty_parser->parse('contentTmpls/act.tpl', $data);
    // Load Footer
    $this->load->view('Templates/footer');
}
但如果我这样做了,就不会:

public function act() {
        @$this->load->library('smarty_parser');
        $this->load->view('Templates/header');
        $data = array('Someinfo');
        $this->smarty_parser->parse('contentTmpls/act.tpl', $data);
        // Load Footer
        $this->load->view('Templates/footer');
    }

header视图调用似乎消失了,并且没有输出任何内容。我想知道是否有人遇到过这个问题或看到了解决方法。

我不确定这是否符合犹太教义,但这里有答案。 我需要切换出一段代码: 从

对此

if ($return == FALSE)
{
    $CI->output->append_output($template);
}

看起来很好用。现在我只需要看看是否有人在维护这段代码以添加补丁。

为什么要执行
@$this->load->library('smarty_parser')是否抛出错误?是的,我使用的是5.3,我收到一条关于不推荐使用的调用的警告。关于在函数调用中使用ref的一些内容,例如:foo(&$data),我已经将问题缩小到Smarty_parser.php行:87$CI->output->final_output=$template;我认为它正在覆盖或不包括标题视图输出。
if ($return == FALSE)
{
    $CI->output->append_output($template);
}