2010-02-16 3 views
0

J'ai beaucoup de pages et je veux attribuer un titre à chaque page comment pouvez-vous id?Comment attribuer des titres pour chaque page par smarty?

J'attribue une page d'accueil, mais je ne peux pas attribuer de pages. la variable ajoutera à header.tpl

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

J'utilise {$} hometitle de $ smarty-> assign ('hometitle', $ hometitle);

Répondre

0

Je ne suis pas certain d'avoir compris la question: Cela aide-t-il?

Dans votre php:

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

Dans vos modèles:

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