开发者

How assign titles for each page by smarty?

i have alot of pages and i want assign title for each page how can id?开发者_如何学Python

i assign home page but cannot assign pages. the variable will add in header.tpl

pages(contact.php,order.php,products.php)

i'm using {$hometitle} $smarty->assign('hometitle',$hometitle);


Not sure I understood the question: Does this help?

In your php:

<?php
  $smarty = new Smarty();
  $smarty->assign('hometitle',$hometitle);
  $smarty->display('index.tpl');
?> 

In your templates:

<html>
  <head>
    <title>{$hometitle}</title>
  </head>
  <body>
    <!--body content here-->
  </body>
</html>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜