Content Page
@param $route
@param callable $callback
485864
public function page($route, $callback) {
        if ($this->configFunction != null) {
            $function = $this->configFunction;
            $result = $function();

            if ($result === false) {
                return;
            }
        }

        $crud = $this;
        
        $this->getSlim()->get($route, function () use ($crud, $callback) {
            $content = $callback();
            
            $this->render($this->getPageLayout(), [
                "content" => $content
            ], true);
        });
    }
323256
public static function get( $route = null, $callback = null ) {
		// Make sure that our parameters are what they say they are
		$args = self::smart_parameters( func_get_args() );

		return self::route( 'GET', $args[ 'route' ], $args[ 'callback' ] );
	}
1026308
public function map($method, $match, $callback)
    {
        $match = $this->base . $match;
        /** @var Route $route */
        $route = $this->routeService
            ->attach($method, $match, $callback)
            ->setGroup($this);
        return $route;
    }
508011
private function mapRoute(string $pattern, callable $callback)
    {
        $word = self::getPattern($pattern);

        $pattern = '/^' . str_replace('/', '\/', $word) . '$/';
        $this->routes[$pattern] = $callback;
    }
681042
function(routes, callback) {
    var newRoutes = {};

    // Alter the root (/test-altering) route.
    routes['/test-altering'].callback = function(request, response) {
      response.send('Testing altering a route!');
    };

    callback(null, newRoutes);
  }
100141
public function contentForInternalRoute($route = null)
    {
        // Get the route
        if (is_null($route)) {
            $route = $this->di->get("request")->getRoute();
        }

        // Check cache for content or create cached version of content
        $slug = $this->di->get("url")->slugify($route);
        $key = $this->di->cache->createKey(__CLASS__, "route-$slug");
        $content = $this->di->cache->get($key);

        if (!$content || $this->ignoreCache) {
            $content = $this->createContentForInternalRoute($route);
            $this->di->cache->put($key, $content);
        }

        return $content;
    }
282140
public function query($method, $pattern, $callback)
    {
        $route = new Route($pattern, $callback, $method);
        $this['router']->addRoute($route);

        return $route;
    }
1358884
public function dispatch($route, $callback)
    {
        return $this->container->call(
            $callback,
            $this->getMethodArguments($route)
        );
    }
829128
def content_for route
      parts = route.split("/").delete_if &:empty?
      content = parts.inject(self) do |page, part|
        page.children[part.to_sym] if page
      end
      content
    end
1203830
protected function renderWithParameters(Route $route, $name = null, array $parameter = array())
    {
        $request = $this->buildRequest($route, $name, $parameter);

        $response = $this->kernel->handle($request);
        $content = $response->getContent();
        $this->kernel->terminate($request, $response);
        $this->kernel->shutdown();

        if (null !== $name) {
            $filename = $this->router->generate($name, $parameter);
        } else {
            $filename = $route->getPath();
        }

        $this->writer->write($filename, $content);
    }
691216
function post($route, callable $controller) {
		if ($this->request->requestMethod() == 'post') {
			$this->any($route, $controller);
		}
	}
620009
public function toRoute($route)
	{
		if ($this->caller != null)
			$this->disableRender[] = $this->caller->identifier;
		$r = $this->router->getRoute($route);
		if ($r != null) {
			$this->currentRoute = $r;
			try {
				$this->execute();
			} catch (\Exception $e) {
				Logger::Log('log/error.txt', $e->getMessage());
				\decoy\base\ErrorController::$errors[] = $e->getMessage();
				$this->toRoute('error_page');
			}
		}
		$this->caller = null;
	}
181085
private function add(string $method, string $route, callable $callable)
	{
		$entry = (object)[
			'route' => $route,
			'pattern' => $this->createPattern($route),
			'callable' => $callable
		];

		if (!array_key_exists($method, $this->routes)) {
			$this->routes[$method] = [];
		}

		$this->routes[$method][] = $entry;
	}
984564
public function getContent($key, $callback)
    {
        if ($this->nestedContentFilter) {
            return $this->nestedContentFilter->getContent($key, $callback);
        } else {
            return call_user_func($callback);
        }
    }
770650
public function bind($path, $callback, $condition = true) {

        if (!$condition) return;

        if (!isset($this->routes[$path])) {
            $this->routes[$path] = [];
        }

        // make $this available in closures
        if (\is_object($callback) && $callback instanceof \Closure) {
            $callback = $callback->bindTo($this, $this);
        }

        // autou-register for /route/* also /route
        if (\substr($path, -2) == '/*' && !isset($this->routes[\substr($path, 0, -2)])) {
            $this->bind(\substr($path, 0, -2), $callback, $condition);
        }

        $this->routes[$path] = $callback;
    }
953160
public function addRoute($method, $route, $callback)
    {
        $route = $this->router->addRoute(strtoupper($method), $this->prefix . '/' . $route, $callback);

        $route->onAny(function($event, $arguments){
            $this->emit($event, $arguments);
        });

        $this->routes[] = $route;

        return $route;
    }
468022
public function put(String $path, Callable $callback) : Route {

		return $this->collectRoute('PUT', $path, $callback);

	}