【问题标题】:php smarty template structurephp smarty模板结构
【发布时间】:2011-01-25 22:15:04
【问题描述】:

我正在使用 smarty 创建简单的 php 应用程序

我有文件头、左、正文和页脚。

主index.php和

模板文件夹中的tpl文件包含ig templates.tpl 其他设计tpl

我在 index.php 中的 templates.tpl 中调用

索引文件包含 url 编码代码。

我也有文件夹 shop 里面有 shop.php 和其他菜单一样...

我已经很好地配置了 smarty 但没有成功?

我在标题和左侧有菜单

当我点击菜单时,它不会只在正文部分显示内容

exa:页眉和左侧部分有 首页、联系我们、商店等菜单...... 我想像往常一样在所有页面中单击正文部分和页眉左侧和页脚中的内容?

如果我点击商店,它将显示在新文件中,其中包含浏览器中显示的 urlencode?​​p>

希望你能理解我的问题?

【问题讨论】:

    标签: php smarty


    【解决方案1】:

    这是我从你的问题中了解到的-

    您有 index.php,它呈现为 templates.tpl 模板和 shop.php 并带有一些菜单(不清楚两者是否具有相同的菜单或不同的菜单)

    您是否将 shop.php 输出渲染到某个模板?像shop.tpl,如果是这样.. 你可以有一个类似的结构

    templates.tpl

    {include file="menu.tpl"}
    <!-- Templates body -->
    

    shop.tpl

    {include file="menu.tpl"}
    <!-- Shop body -->
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-05-27
      • 1970-01-01
      • 1970-01-01
      • 2013-08-19
      • 2012-06-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多