php - Change the uri of a module without renaming the class in PyroCMS -
what best way change uri of module without renaming class. example i'd blog module show:
/blog/post-title -> /news/post-title
routes.php?
first added routes.php.
$route['news/([0-9]+)/([0-9]+)/([a-za-z0-9_-]+)'] = 'blog/$1/$2/$3';
then make sure correct links added blog plugin.php.
foreach ($posts &$post) { $post->url = str_replace('blog/', 'news/', $post->url); }
Comments
Post a Comment