A new, object-oriented, better vesion of μForum
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
612 B

  1. <?php
  2. /**
  3. * @package uForum2
  4. * @file inc/view.class.php
  5. * @copyright 2007-2015 (c) PioDer
  6. * @link http://www.pioder.pl/
  7. * @license see LICENSE.txt
  8. **/
  9. abstract class View extends AskModel
  10. {
  11. protected $TPL = array();
  12. protected $db;
  13. function show($template)
  14. {
  15. if (file_exists('./templates/'.$template.'.tpl.php'))
  16. require_once('./templates/'.$template.'.tpl.php');
  17. else
  18. throw new Exception('Could not show selected template: '.$template);
  19. }
  20. function assign($n, $v) //osadzanie elementu skórki
  21. {
  22. $this->TPL[$n] = $v;
  23. }
  24. function __construct(&$db)
  25. {
  26. $this->db = $db;
  27. }
  28. }
  29. ?>