从多个块构建模板

发布于 2025-01-12 14:38:05 字数 450 浏览 4 评论 0原文

大家好!希望你今天过得愉快。 我今天的挑战是...我可以有一个模板 (ctp),其中包含来自单独 CTP 模板的嵌套块吗?例如:

某些带有标题的表单以及不带有

<h1 id-"Something">Testing</h1>
<div class="main section">
   <div class="">
       -Section 1 - this would another ctp (include **section1.ctp**)
       -Section 2 - this would another ctp (include **section2.ctp**)
   </div>
</div>
<footer>something here</footer>

标题的表单的其余部分

Good day everyone! hope you are having a good day.
My challenge today is... Can I have a template (ctp) with nested blocks from separate CTP templates. For instance:

Some form with headers and what not

<h1 id-"Something">Testing</h1>
<div class="main section">
   <div class="">
       -Section 1 - this would another ctp (include **section1.ctp**)
       -Section 2 - this would another ctp (include **section2.ctp**)
   </div>
</div>
<footer>something here</footer>

Rest of the form

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

迷鸟归林 2025-01-19 14:38:05

是的,你可以,一切都在 cakephp 书中清楚地记录了

  • Extending Views &&使用视图块
  • 元素

https: //book.cakephp.org/4/en/views.html

CakePHP3

Yes, you can, everything is neatly documented in the cakephp book

  • Extending Views && Using View Blocks
  • Elements

https://book.cakephp.org/4/en/views.html

the same is for CakePHP3

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