43 public function getLink($sNav,$tParam=null,$bAmp=null){
44 foreach($this->tRoute as $sUrl=>$tUrl){
45 if($tUrl[
'nav']==$sNav and !isset($tUrl[
'tParam']) and $tParam==null){
46 return $this->convertUrl($sUrl,$tParam);
47 }elseif($tUrl[
'nav']==$sNav and isset($tUrl[
'tParam']) and is_array($tUrl[
'tParam']) and is_array($tParam) ){
49 foreach($tUrl[
'tParam'] as $val){
50 if(!isset($tParam[$val])){
55 return $this->convertUrl($sUrl,$tParam);
67 $sRootScript=$_SERVER[
'SCRIPT_NAME'];
69 $sUrl=str_replace($sRootScript,
'',$sUrl);
72 if(is_array($this->tRoute)){
73 foreach($this->tRoute as $sPattern => $tUrl){
74 $sPattern=preg_replace(
'/:([^:])*:/',
'([^/]*)',$sPattern);
75 $sPattern=preg_replace(
'/\//',
'\/',$sPattern);
77 if(preg_match_all(
'/^'.$sPattern.
'$/',$sUrl,$tTrouve)){
79 if(isset($tUrl[
'tParam']) and is_array($tTrouve[1])){
81 foreach($tTrouve as $i => $found){
89 if(isset($tUrl[
'tParamHidden'])){
90 foreach($tUrl[
'tParamHidden'] as $key => $val){
98 utilisation de 404 loadModuleAndAction('.$this->tRoute[
'404'][
'nav'].
')');
105 private function convertUrl($sUrl,$tParam=null){
106 if(is_array($tParam)){
107 foreach($tParam as $sVar => $sVal){
108 $sUrl=preg_replace(
'/:'.$sVar.
':/',$sVal,$sUrl);
static getConfigVar($sCatAndVar, $uDefaut=null)
getLink($sNav, $tParam=null, $bAmp=null)
static getLinkString($sNav, $tParam=null, $bAmp=true)
static setParam($sVar, $uValue)