Commit 83ace2de by Taylor Otwell

moved routing classes into system namespace.

parent ce96fb67
......@@ -138,7 +138,7 @@ if (System\Config::get('session.driver') != '')
// --------------------------------------------------------------
// Execute the global "before" filter.
// --------------------------------------------------------------
$response = System\Route\Filter::call('before', array(), true);
$response = System\Route_Filter::call('before', array(), true);
// ----------------------------------------------------------
// Execute the route function.
......@@ -157,7 +157,7 @@ else
// ----------------------------------------------------------
// Execute the global "after" filter.
// ----------------------------------------------------------
System\Route\Filter::call('after', array($response));
System\Route_Filter::call('after', array($response));
// ----------------------------------------------------------
// Stringify the response.
......
......@@ -55,7 +55,7 @@ class Route {
}
elseif (is_array($this->callback))
{
$response = isset($this->callback['before']) ? Route\Filter::call($this->callback['before'], array(), true) : null;
$response = isset($this->callback['before']) ? Route_Filter::call($this->callback['before'], array(), true) : null;
if (is_null($response) and isset($this->callback['do']))
{
......@@ -67,7 +67,7 @@ class Route {
if (is_array($this->callback) and isset($this->callback['after']))
{
Route\Filter::call($this->callback['after'], array($response));
Route_Filter::call($this->callback['after'], array($response));
}
return $response;
......
<?php namespace System\Route;
<?php namespace System;
class Filter {
class Route_Filter {
/**
* The loaded route filters.
......
<?php namespace System\Route;
<?php namespace System;
class Finder {
class Route_Finder {
/**
* All of the loaded routes.
......
......@@ -71,7 +71,7 @@ class URL {
*/
public static function to_route($name, $parameters = array(), $https = false)
{
if ( ! is_null($route = Route\Finder::find($name)))
if ( ! is_null($route = Route_Finder::find($name)))
{
$uris = explode(', ', key($route));
......@@ -109,7 +109,7 @@ class URL {
*/
public static function slug($title, $separator = '-')
{
$title = html_entity_decode(Str::ascii($title), ENT_QUOTES, Config::get('application.encoding'));
$title = Str::ascii($title);
// Remove all characters that are not the separator, letters, numbers, or whitespace.
$title = preg_replace('![^'.preg_quote($separator).'\pL\pN\s]+!u', '', Str::lower($title));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment