Correct way / function / object to show a new Link?
Posted: Thu Jun 16, 2022 1:53 pm
Hi All
I want to make a link the right way, so it's also renamed from the addon name_based_url.
Is the correct way this:
$GLOBALS['Linker']->build('index.php?cPath=864_1920');
because the link is not changed to the "name_based_url" so probably I make something wrong...
edit:
I see when I use $GLOBALS['Linker']->build('index.php', ['cPath' => '864_1920']) then the rewrite works, but what should I do if I have "index.php?cPath=864_1920" saved in the MySQL DB?
Does it have a function to parse the parameter or do I have to do it myself and separate the file from the parameter manually to make this writing, like this?
I want to make a link the right way, so it's also renamed from the addon name_based_url.
Is the correct way this:
$GLOBALS['Linker']->build('index.php?cPath=864_1920');
because the link is not changed to the "name_based_url" so probably I make something wrong...
edit:
I see when I use $GLOBALS['Linker']->build('index.php', ['cPath' => '864_1920']) then the rewrite works, but what should I do if I have "index.php?cPath=864_1920" saved in the MySQL DB?
Does it have a function to parse the parameter or do I have to do it myself and separate the file from the parameter manually to make this writing, like this?
Code: Select all
$url_components = parse_url($c['advert_url']);
parse_str($url_components['query'], $params);
$inner .= '<a href="' . $GLOBALS['Linker']->build('index.php', $params) . '">';