original_string: 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;
  
      }
code: 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;
  
      }
code_tokens: 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 ; }
docstring: Parse the template for variables.
  
  @return array
docstring_tokens: Parse the template for variables .