在 CI 中,我们都知道您可以将 View 分配给变量,例如:
$a = $this->load->view('theview',$data,true);
是否可以像这样解析器函数:
$a = $this->parser->parse('thetemplate',$data,true);
最佳答案
是的,这有效:
$string = $this->parser->parse('thetemplate', $data, TRUE);
末尾的 TRUE
避免将其发送到输出类
参见:CI Parser
关于php - codeIgniter 将解析器结果分配给变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14846163/