Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Url
- {
- public static function toSongLink($song)
- {
- $basepath = '/MySong/src/controllers/SongController.php';
- return '<a href="' . $basepath . '?' . 'song=' . $song . '">' . $song . '</a>';
- }
- public static function toSong($song)
- {
- $basepath = '/MySong/src/views/song.php';
- return $basepath . '?' . 'song=' . $song;
- }
- public static function toSongUpdate($song)
- {
- $basepath = '/MySong/src/views/songupdate.php';
- return $basepath . '?' . 'song=' . $song;
- }
- public static function toSongCreate()
- {
- $basepath = '/MySong/src/views/songcreate.php';
- return $basepath;
- }
- public static function toSongList()
- {
- $basepath = '/MySong/src/views/songlist.php';
- return $basepath;
- }
- public static function toHome()
- {
- return '/MySong/index.php';
- }
- public static function toView($view)
- {
- $basepath = '/MySong/src/views/';
- return $basepath . $view . '.php';
- }
- public static function toController($controller, $action, $id = null)
- {
- if($id != null){
- $basepath = '/MySong/src/controllers/';
- return $basepath . ucwords($controller) . 'Controller.php/' . $action . '?' . $controller. '=' . $id;
- } else {
- $basepath = '/MySong/src/controllers/';
- return $basepath . ucwords($controller) . 'Controller.php/' . $action;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement