Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Smarty szablon
seba199696
post
Post #1





Grupa: Zarejestrowani
Postów: 119
Pomógł: 0
Dołączył: 4.01.2011

Ostrzeżenie: (20%)
X----


Co o tym myślicie? Dobrze to robię?

index.php
  1. if(!isset($_SESSION['status'])) {
  2.  
  3. include("login.php");
  4. $body_template = "templates/login.tpl";
  5.  
  6. } else {
  7.  
  8. if(isset($_GET['page'])) {
  9.  
  10. $module = basename($_GET['page']);
  11.  
  12. if((file_exists("$module.php")) and file_exists("templates/" . $module . ".tpl")) {
  13. include("$module.php");
  14. $body_template = "templates/$module.tpl";
  15. } else {
  16. $body_template = "templates/404.tpl";
  17. }
  18.  
  19. } else {
  20. include("home.php");
  21. $body_template = "templates/home.tpl";
  22. }
  23. }
  24.  
  25. $smarty->assign('body',$body_template);
  26. $smarty->display('index.tpl');


index.tpl


{include file=$body}
Go to the top of the page
+Quote Post

Posty w temacie
- seba199696   Smarty szablon   1.12.2011, 21:28:01


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 23:06