构建模块公共页面时如何添加附加视图(部分视图)?

发布于 2024-10-09 09:29:56 字数 835 浏览 0 评论 0原文

请看一下这段代码 // 创建事件输出 $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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

落日海湾 2024-10-16 09:29:57

根本不是一个愚蠢的问题。要更好地了解模板库,请查看其具体文档:

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. :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文