|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
edge82 Smarty n00b
Joined: 03 Feb 2014 Posts: 1
|
Posted: Mon Feb 03, 2014 6:00 am Post subject: Remove white space and characters from URL in smarty. |
|
|
Hi,
I am getting some special characters in URL and want to know how to remove them.
http%3A%2F%2Flocalhost%2Fdemo2%2Findex.php%3Fid_product%3D20%26controller%3Dproduct%26id_lang%3D1
Following is my php function using urlencode and try different possibilities but no result.
Code: |
public function hookExtraLeft($params)
{
global $smarty, $cookie, $link;
$id_product = Tools::getValue('id_product');
if (isset($id_product) && $id_product != '')
{
$product_infos = $this->context->controller->getProduct();
$smarty->assign(array(
'product_link' => urlencode($link->getProductLink($product_infos)),
'product_title' => urlencode($product_infos->name),
));
return $this->display(__FILE__, 'blocksharefb.tpl');
} else {
return '';
}
}
|
Any idea?
-Thanks |
|
Back to top |
|
ameerko2u Smarty n00b
Joined: 17 Jun 2014 Posts: 3
|
Posted: Wed Jun 18, 2014 1:47 am Post subject: same problem here |
|
|
i got same problem but, with certine characters like % or ?
it makes spaces and errors with url links then i get page not found 404 error |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|