Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/75.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/6.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变量加载视图的一部分_Php_Html_Codeigniter - Fatal编程技术网

使用PHP变量加载视图的一部分

使用PHP变量加载视图的一部分,php,html,codeigniter,Php,Html,Codeigniter,我使用PHP变量在by main视图中加载视图的一部分 下面是视图的代码 <body> <div id="wrapper"> <div id="gallery"> <?= $view_thing ?> </div> </div> </body> 但问题是“$view\u thing”在我编写它的div中没有显示内容,这个页面显示在body标签下面 注意:我只从视图中编写了一部分代码,视图

我使用PHP变量在by main视图中加载视图的一部分 下面是视图的代码

<body>
<div id="wrapper">
   <div id="gallery">
      <?= $view_thing ?>
   </div>
</div>
</body>
但问题是“$view\u thing”在我编写它的div中没有显示内容,这个页面显示在body标签下面


注意:我只从视图中编写了一部分代码,视图加载器函数需要第三个参数将其作为字符串返回,例如:

$data['view_thing']=$this->load->view('model/portion', $data, true);

您是否检查了
$data['view\u thing']
var\u dump($data['view\u thing'])
只需尝试赋值,比如
$data['view\u thing']=$data
@HüseyinBABAL那是什么,它会做什么?
$data['view\u thing']
可能是
null
。在说“它什么也没显示”之前检查值“$data['view\u thing']不为空,视图显示在主页上,但不在正确的位置
$data['view_thing']=$this->load->view('model/portion', $data, true);