Guest User

Untitled

a guest
Feb 25th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. <?php
  2. include('Smarty.class.php');
  3. include('Databas.php');
  4.  
  5. $smarty = new Smarty;
  6. $db = Database();
  7.  
  8. // Get URL parameters - not sure this way is the correct
  9. $firstname = isset($_GET["search"]) ? $_GET["search"] : "";
  10. // Load users with the given firstname from DB
  11. $users = $db->usersWithFirstname($firstname);
  12.  
  13. // Assign data to smarty
  14. $smarty->assign('users',$users);
  15. // Display the template.
  16. $smarty->display('View.tpl');
  17. // Fetch only return the string and can be used as this:
  18. // $rendered = $smarty->fetch('View.tpl');
  19. // echo $rendered;
  20. ?>
Add Comment
Please, Sign In to add comment