Lime\App::bind PHP Method

bind() public method

Bind request to route
public bind ( String $path, Closure $callback, boolean $condition = true ) : void
$path String
$callback Closure
$condition boolean
return void
    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);
        }
        $this->routes[$path] = $callback;
    }