protected function parse_template() {

        if (empty($this->params)) {
            $this->params = array();
            if (isset($_SERVER['PATH_INFO']) && !empty($_SERVER['PATH_INFO'])) {
                $path = explode('/', $_SERVER['PATH_INFO']);
                $parts = explode('/', $this->get_template());
                for ($i = 0; $i < count($parts); $i++) {
                    if ((substr($parts[$i], 0, 1) == '{') && (substr($parts[$i], -1) == '}')) {
                        $value = '';
                        if ($i < count($path)) {
                            $value = $path[$i];
                        }
                        $this->params[substr($parts[$i], 1, -1)] = $value;
                    }
                }
            }
        }

        return $this->params;

    }
protected function parse_template() {

        if (empty($this->params)) {
            $this->params = array();
            if (isset($_SERVER['PATH_INFO']) && !empty($_SERVER['PATH_INFO'])) {
                $path = explode('/', $_SERVER['PATH_INFO']);
                $parts = explode('/', $this->get_template());
                for ($i = 0; $i < count($parts); $i++) {
                    if ((substr($parts[$i], 0, 1) == '{') && (substr($parts[$i], -1) == '}')) {
                        $value = '';
                        if ($i < count($path)) {
                            $value = $path[$i];
                        }
                        $this->params[substr($parts[$i], 1, -1)] = $value;
                    }
                }
            }
        }

        return $this->params;

    }
protected function parse_template ( ) { if ( empty ( $ this -> params ) ) { $ this -> params = array ( ) ; if ( isset ( $ _SERVER [ 'PATH_INFO' ] ) && ! empty ( $ _SERVER [ 'PATH_INFO' ] ) ) { $ path = explode ( '/' , $ _SERVER [ 'PATH_INFO' ] ) ; $ parts = explode ( '/' , $ this -> get_template ( ) ) ; for ( $ i = 0 ; $ i < count ( $ parts ) ; $ i ++ ) { if ( ( substr ( $ parts [ $ i ] , 0 , 1 ) == '{' ) && ( substr ( $ parts [ $ i ] , - 1 ) == '}' ) ) { $ value = '' ; if ( $ i < count ( $ path ) ) { $ value = $ path [ $ i ] ; } $ this -> params [ substr ( $ parts [ $ i ] , 1 , - 1 ) ] = $ value ; } } } } return $ this -> params ; }
Parse the template for variables.

@return array
Parse the template for variables .