示例#1
0
 /** 
  * retourne l'url rewrite 
  * @access public
  * @param string $sNav variable de navigation exple article::list
  * @param array $tParam tableau de parametre
  * @param bool $bAmp retourne l'url avec ou sans les &
  */
 public function getLink($sNav, $tParam = null, $bAmp = null)
 {
     foreach ($this->tRoute as $sUrl => $tUrl) {
         if ($tUrl['nav'] == $sNav and !isset($tUrl['tParam']) and $tParam == null) {
             return $this->convertUrl($sUrl, $tParam);
             //si pas de parametres des deux cotes, c est la bonne regle
         } elseif ($tUrl['nav'] == $sNav and isset($tUrl['tParam']) and is_array($tUrl['tParam']) and is_array($tParam)) {
             foreach ($tUrl['tParam'] as $val) {
                 if (!isset($tParam[$val])) {
                     continue 2;
                 }
             }
             return $this->convertUrl($sUrl, $tParam);
             //si la regle demande des parametres, tous presents dans les parametres passes on choisi celle-ci
         }
     }
     return _root::getLinkString($sNav, $tParam, $bAmp);
 }