【问题标题】:codeIgniter assign parser result to variablecodeIgniter 将解析器结果分配给变量
【发布时间】:2013-02-13 03:59:23
【问题描述】:

在 CI 中,我们都知道您可以将视图分配给如下变量:

$a = $this->load->view('theview',$data,true);

这样解析函数是否可行:

$a = $this->parser->parse('thetemplate',$data,true);

【问题讨论】:

    标签: php codeigniter codeigniter-2


    【解决方案1】:

    是的,这行得通:

    $string = $this->parser->parse('thetemplate', $data, TRUE);
    

    末尾的TRUE 避免将其发送到输出类

    见:CI Parser

    【讨论】:

    • 是的,它现在正在工作。传递数据和库拼写时出现一些语法错误。所有我认为这是无效的,因为它在我之前不起作用。无论如何,谢谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-02-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多