Advertisement
Guest User

Untitled

a guest
Mar 31st, 2015
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. <?php
  2.  
  3. class Url
  4. {
  5.  
  6. public static function toSongLink($song)
  7. {
  8. $basepath = '/MySong/src/controllers/SongController.php';
  9.  
  10. return '<a href="' . $basepath . '?' . 'song=' . $song . '">' . $song . '</a>';
  11.  
  12. }
  13.  
  14. public static function toSong($song)
  15. {
  16.  
  17. $basepath = '/MySong/src/views/song.php';
  18.  
  19.  
  20. return $basepath . '?' . 'song=' . $song;
  21.  
  22. }
  23.  
  24. public static function toSongUpdate($song)
  25. {
  26.  
  27. $basepath = '/MySong/src/views/songupdate.php';
  28.  
  29.  
  30. return $basepath . '?' . 'song=' . $song;
  31.  
  32. }
  33.  
  34. public static function toSongCreate()
  35. {
  36.  
  37. $basepath = '/MySong/src/views/songcreate.php';
  38.  
  39.  
  40. return $basepath;
  41.  
  42. }
  43.  
  44. public static function toSongList()
  45. {
  46.  
  47. $basepath = '/MySong/src/views/songlist.php';
  48.  
  49.  
  50. return $basepath;
  51.  
  52. }
  53.  
  54.  
  55.  
  56. public static function toHome()
  57. {
  58.  
  59. return '/MySong/index.php';
  60.  
  61. }
  62.  
  63.  
  64. public static function toView($view)
  65. {
  66.  
  67. $basepath = '/MySong/src/views/';
  68.  
  69. return $basepath . $view . '.php';
  70.  
  71. }
  72.  
  73. public static function toController($controller, $action, $id = null)
  74. {
  75.  
  76. if($id != null){
  77.  
  78. $basepath = '/MySong/src/controllers/';
  79.  
  80. return $basepath . ucwords($controller) . 'Controller.php/' . $action . '?' . $controller. '=' . $id;
  81.  
  82. } else {
  83.  
  84. $basepath = '/MySong/src/controllers/';
  85.  
  86. return $basepath . ucwords($controller) . 'Controller.php/' . $action;
  87.  
  88. }
  89.  
  90. }
  91.  
  92.  
  93. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement