Skip to content
This repository has been archived by the owner on Nov 2, 2018. It is now read-only.

Commit

Permalink
Cleaned up Zepto\Router
Browse files Browse the repository at this point in the history
  • Loading branch information
hassankhan committed Nov 12, 2013
1 parent 5f1ab43 commit f6434ae
Showing 1 changed file with 12 additions and 36 deletions.
48 changes: 12 additions & 36 deletions library/Zepto/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,32 +154,6 @@ public function __construct($url = null)
$this->url_clean = $this->__get_clean_url($this->url_dirty);
}

/**
* Enables the display of errors such as malformed URL routing rules or
* conflicting routing rules. Not recommended for production sites.
*
* @return self
*/
public function show_errors()
{
$this->show_errors = true;

return $this;
}

/**
* Disables the display of errors such as malformed URL routing rules or
* conflicting routing rules. Not recommended for production sites.
*
* @return self
*/
public function hide_errors()
{
$this->show_errors = false;

return $this;
}

/**
* If the router cannot match the current URL to any of the given routes,
* the function passed to this method will be executed instead. This would
Expand All @@ -195,16 +169,6 @@ public function default_route($callback)
return $this;
}

/**
* Returns all routes mapped on the routing table.
*
* @return array
*/
public function get_routes()
{
return $this->routes;
}

/**
* Tries to match one of the URL routes to the current URL, otherwise
* execute the default function and return false.
Expand Down Expand Up @@ -356,6 +320,18 @@ public function route($route, $callback, $request_method = 'GET')
return true;
}

/**
* Returns all routes mapped on the routing table.
*
* @return array
* @todo Fix this shitty implementation and make it return one
* single array with all routes
*/
public function get_routes()
{
return $this->routes;
}

/**
* Retrieves the part of the URL after the base (Calculated from the location
* of the main application file, such as index.php), excluding the query
Expand Down

0 comments on commit f6434ae

Please sign in to comment.