Controller
function delete_payment($payment_id)
{
$this->sale_lib->delete_payment($payment_id);
$this->_reload();
}
View
<?php echo anchor("sales/delete_payment/$payment_id",'['.$this->lang->line('common_delete').']');?>
It is possible for $payment_id to be something like “Gift Card:1” or “Gift Card:12345983984334”
When it is Gift Card:1 the url is automatically decoded and the delete function works, when it is a longer string such as Gift Card:12345983984334″ the url is NOT decoded.
URLS are:
http://localhost/index.php/sales/delete_payment/Gift%20Card:1
http://localhost/index.php/sales/delete_payment/Gift%20Card:12345983984334
First one works, second one doesn’t
Actually, I just tried to replicate your situation on my local machine (WAMP on Windows 7) and you’re right. I tried on all major browsers (FF4,IE9,Chrome) and saw no differences.
Although this doesn’t really answers your question, you can always rig a workaround like this with php function rawurldecode:
In this way you’ll have your ‘id’ in the form
Gift Card:123456789(I tried with different lenghts and alwyas worked), ready for your model.