You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Si, dans les pages statiques par exemple, on veut indiquer une ancre à la suite d'une url (du style url#ancre), la méthode plxUtils::title2url modifie le tout en url-ancre.
Pour que cela soit pris en compte, je propose la modification suivante :
/** * Méthode qui convertit une chaine de caractères au format valide pour une url * * @param str chaine de caractères à formater * @return string nom d'url valide **/publicstaticfunctiontitle2url($str) {
$vars = explode('#',$str);
$url = '';
foreach ($varsas$key => $value) {
$str = strtolower(plxUtils::removeAccents($value,PLX_CHARSET));
$str = preg_replace('/[^[:alnum:]]+/','',$str);
$str = strtr(trim($str), '', '-');
$vars[$key] = $str;
}
$url = $vars[0].(isset($vars[1]) ? '#'.$vars[1] : '');
return$url;
}
The text was updated successfully, but these errors were encountered:
Cela fonctionne au niveau de la modification de l'url mais l'ancre est conservée dans la regex de recherche des pages associées (catégories, articles...) et donc aucune page n'est trouvée.
Je ne sais pas ce que ça implique au niveau modification des regex...
Si, dans les pages statiques par exemple, on veut indiquer une ancre à la suite d'une url (du style
url#ancre
), la méthode plxUtils::title2url modifie le tout enurl-ancre
.Pour que cela soit pris en compte, je propose la modification suivante :
The text was updated successfully, but these errors were encountered: