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}