简体   繁体   English

PHP Smarty模板结构

[英]php smarty template structure

and i am creating simple php application with using smarty 我正在使用smarty创建简单的php应用程序

i have file header, left ,body, and footer. 我有文件头,左,身体和页脚。

main index.php and 主要index.php和

tpl file in templates folder containig templates.tpl other design tpl 模板文件夹中的tpl文件containig templates.tpl其他设计tpl

i am calling in templates.tpl in index.php 我在index.php中调用templates.tpl

index file contains url encode code. 索引文件包含url编码代码。

i have also folder shop which have shop.php and same with other menu ... 我也有shop.php和其他菜单相同的文件夹店...

i have configured smarty well but not succeed? 我已经很好地配置了smarty,但是没有成功?

i have menu in header and left 我在标题和左侧都有菜单

when i click in menu than it will be not display the content in only body part 当我在菜单中单击时,它将不会仅在身体部位显示内容

exa: header and left part has menu like home, contact us , shop and etc ..... i want click content in body part and header left and footer as usual through the all pages? 例如:页眉和左侧部分有菜单,如首页,联系我们,商店等...我希望在正文中单击内容,页眉左侧和页脚照常浏览所有页面吗?

if i click on shop it will be display in new file and which containing the urlencode which shows in browser ? 如果我单击商店,它将显示在新文件中,并且其中包含在浏览器中显示的urlencode?

i hope you understand my question ? 我希望你能理解我的问题?

This is what I understand from your question- 这是我从您的问题中了解的-

You have index.php which renders to templates.tpl template and shop.php with some menus(Not clear if both have the same menus or different) 你有index.php可以通过一些菜单渲染成template.tpl模板和shop.php(不清楚两个菜单是否相同或不同)

Are you rendering shop.php output to some template? 您是否将shop.php输出渲染到某些模板? like shop.tpl, if so.. You can have a structure something like 像shop.tpl,如果是这样的话。

templates.tpl templates.tpl

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

shop.tpl shop.tpl

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM