在codeigniter中使用常量加载视图

时间:2016-11-23 10:56:25

标签: codeigniter

我想在codeigniter中使用常量加载视图,只需要通过打印常量视图加载。是否可以在 codeigniter

define('SEARCH_POP_START_TAG',$this->load->view('templates/search_pop_start_tag.php'));

1 个答案:

答案 0 :(得分:2)

您可能希望将视图作为String返回,请参阅View documentation并将视图作为数据返回。不确定将视图定义为常量是否是最好的架构。

如:

$string = $this->load->view('myfile', '', TRUE);
相关问题