src/Koldy/Route/DefaultRoute.php
public function getVar($whatVar, $default = null)
    {
        if (is_numeric($whatVar)) {
            $whatVar = (int)$whatVar + 1;

            if (isset($this->uri[$whatVar])) {
                $value = trim($this->uri[$whatVar]);
                return ($value != '') ? $value : $default;
            } else {
                return $default;
            }
        } else {
            // if variable is string, then treat it like GET parameter
            if (isset($_GET[$whatVar])) {
                $value = trim($_GET[$whatVar]);
                return ($value != '') ? $value : $default;
            } else {
                return $default;
            }
        }
    }
public function getVar($whatVar, $default = null)
    {
        if (is_numeric($whatVar)) {
            $whatVar = (int)$whatVar + 1;

            if (isset($this->uri[$whatVar])) {
                $value = trim($this->uri[$whatVar]);
                return ($value != '') ? $value : $default;
            } else {
                return $default;
            }
        } else {
            // if variable is string, then treat it like GET parameter
            if (isset($_GET[$whatVar])) {
                $value = trim($_GET[$whatVar]);
                return ($value != '') ? $value : $default;
            } else {
                return $default;
            }
        }
    }
public function getVar ( $ whatVar , $ default = null ) { if ( is_numeric ( $ whatVar ) ) { $ whatVar = ( int ) $ whatVar + 1 ; if ( isset ( $ this -> uri [ $ whatVar ] ) ) { $ value = trim ( $ this -> uri [ $ whatVar ] ) ; return ( $ value != '' ) ? $ value : $ default ; } else { return $ default ; } } else { // if variable is string, then treat it like GET parameter if ( isset ( $ _GET [ $ whatVar ] ) ) { $ value = trim ( $ _GET [ $ whatVar ] ) ; return ( $ value != '' ) ? $ value : $ default ; } else { return $ default ; } } }
Get the variable value from parameters

@param string $whatVar
@param string $default

@return mixed|null|string
Get the variable value from parameters