html 中的 echo module::run() 跳转到 doctype 之前
我正在使用 HMVC 并在视图中调用模块。然而,在某些情况下,模块出现在 Doctype 之前!这似乎是由于在一页中调用多个模块引起的,但我也有这样的情况,当我这样做时却没有发生这种情况。
我正在解析我想要从控制器显示到视图中的模块 就像:
$data['modules'] = array(
'controller/function',
);
$this->load->view('page', $data);
然后在视图中,
foreach($modules as $module){ ?>
<div>
<?php echo modules::run(module); ?>
</div>
<?php }
这些 div 打印得很好,并保留在它们应该在的位置,但由于某种原因,模块在 doctype 之前跳转。我已经检查过整个页面中的所有 div 都已关闭,以干扰两个模块中的代码等,但仍然不知所措,
我以前从未遇到过这种情况,有人可以帮忙吗? 谢谢 :)
I'm using HMVC and calling modules in a view. In some cases however, the modules appear before the Doctype! It seems to be caused by calling more than one module into a page but i have instances when i have done this without this happening.
i'm parsing the modules I want to display from the controller into the view
like:
$data['modules'] = array(
'controller/function',
);
$this->load->view('page', $data);
then in the view
foreach($modules as $module){ ?>
<div>
<?php echo modules::run(module); ?>
</div>
<?php }
these divs print fine, and remain where they are supposed to, but for some reason the module jumps before doctype. I've checked that all divs in the whole page are closed, for interfering code in the two modules etc but still at a loss
I've never come across this before, can anyone help?
Thanks :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是链接到这篇文章,我通过将第三个参数设置为
TRUE
并像这样回显视图echo $this->load->view('account_managers', $data, TRUE);
This is linked to this post and i fixed it by setting the third parameter to
TRUE
and echoing the view like thisecho $this->load->view('account_managers', $data, TRUE);