Monster_Page.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * Monster view page file.
  4. *
  5. * Provides a class with all the properties and methods to display the page.
  6. *
  7. * @category Page
  8. */
  9. /**
  10. * Require dependent files if not present.
  11. */
  12. require_once(PATH::PAGE . "Page.php");
  13. require_once(PATH::ENTITY . "Unit.php");
  14. /**
  15. * Monster view page model.
  16. *
  17. * @category Page
  18. */
  19. class Monster_Page extends Page{
  20. /**
  21. * @var Unit Selected Unit.
  22. */
  23. public $unit;
  24. /**
  25. * Constructor.
  26. *
  27. * Retrieves the data and initializes the variables.
  28. *
  29. * @param string $id Selected unit id
  30. * @global resource Database connection.
  31. */
  32. public function __construct($id){
  33. global $db;
  34. $this->view = PATH::VIEW . "monster.php";
  35. $this->unit = new Unit($id);
  36. $this->title = $this->unit->unit->name ." - SWDB";
  37. $this->description = "Owned " . $this->unit->unit->name;
  38. $this->canonical = URL::BASE . "monster/" . $id;
  39. }
  40. }
  41. ?>