Example #1
0
 /**
  * 
  * Rewrite the URI path according to a dynamic ruleset.
  * 
  * @param Solar_Uri $uri The URI to rewrite in place.
  * 
  * @return void
  * 
  */
 protected function _rewrite($uri)
 {
     // does it match a rewrite rule?
     $newpath = $this->_rewrite->match($uri);
     if ($newpath) {
         $uri->setPath($newpath);
         $this->_explain['rewrite_rule'] = $this->_rewrite->explain();
         $this->_explain['rewrite_uri'] = $uri->getFrontPath();
     } else {
         $this->_explain['rewrite_rule'] = $this->_rewrite->explain();
     }
 }
 /**
  * 
  * Returns an escaped href or src attribute value for a named action
  * from the rewrite rules, using data interpolation.
  * 
  * @param string $name The named action from the rewrite rules.
  * 
  * @param array $data Data to interpolate into the token placeholders.
  * 
  * @return string
  * 
  */
 public function namedActionHref($name, $data = null)
 {
     $href = $this->_rewrite->getPath($name, $data);
     return $this->_view->escape($href);
 }