PageFactory.php 507 B

12345678910111213141516171819202122232425
  1. <?php
  2. class PageFactory {
  3. public static function getInstance() {
  4. return new PageFactory();
  5. }
  6. public function create($pathData) {
  7. switch($pathData) {
  8. case "/index":
  9. return new Page("index");
  10. case "/jobs":
  11. return new Page("jobs");
  12. case "/cardtrick":
  13. case "/games/cardtrick":
  14. return new Page("cardtrick");
  15. case "/process":
  16. return new Page("process");
  17. case "/contact-us":
  18. return new Page("contactUs");
  19. default:
  20. return new Page("404");
  21. }
  22. }
  23. }