构建模块公共页面时如何添加附加视图(部分视图)?
请看一下这段代码 // 创建事件输出 $this->template->title($event->meta_title)
->set_metadata('keywords', $event->meta_keywords)
->set_metadata('description', $event->meta_description)
->set('event', $event_array)
->append_metadata('
<style type="text/css">
' . $event->layout->css . '
' . $event->css . '
</style>
<script type="text/javascript">
' . $event->js . '
</script>')
->build('event', $this->data);
}
这是构造页面的控制器方法的部分代码。如果我想加载另一个视图(部分视图),例如partial/form.php,并绕过数据给它()。之后,我想在评论之前(在输出之前)在活动文章之后显示表单。我该如何实现它?抱歉我的愚蠢问题。我对 PyroCMS、PHP、MVC 很陌生 去感受它并尝试一下。
实践。我只知道理论。现在
,我让自己
Please take a look at this code
// Create event output
$this->template->title($event->meta_title)
->set_metadata('keywords', $event->meta_keywords)
->set_metadata('description', $event->meta_description)
->set('event', $event_array)
->append_metadata('
<style type="text/css">
' . $event->layout->css . '
' . $event->css . '
</style>
<script type="text/javascript">
' . $event->js . '
</script>')
->build('event', $this->data);
}
This is a partial code from a controller method which construct a page. If I want to load another view (partial view) such partial/form.php and bypass a data to it (). After that, I'd like to display the form after the event's article right before the comments (before the output of. How do I make it happened? Sorry for my silly questions. I'm quite new to PyroCMS, PHP, MVC on practice. :D. I only knew the theory. Now, I let myself to dive in to feel it and try it.
Thanks a bunch.
Merry XMAS
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根本不是一个愚蠢的问题。要更好地了解模板库,请查看其具体文档:
http://philsturgeon.co .uk/demos/codeigniter-template/user_guide/
PyroCMS 使用了我的很多库,其中一些有文档,有些没有。我需要抽出时间来完成这一切,但这是一项吃力不讨好的巨大任务,而且我已经有很多事情要做了。 :)
Not a silly question at all. To understand the template library better, check out its specific documentation:
http://philsturgeon.co.uk/demos/codeigniter-template/user_guide/
PyroCMS uses lots of my libraries, some of which have documentation and some don't. I need to get around to getting it all done but its a massive thankless task and I have plenty on my plate already. :)