doflamingo doflamingo - 1 month ago 6
HTML Question

Codeigniter has already double quote , and single quote already how to echo base_url

I'm doing a shopping cart and I want to make a logo button that when user clicks on the logo button it will delete an order.(it will anchor to method remove in controller)

I want to assign variable like this

<?php
$path = "<img src='echo base_url("images/cart_cross.jpg");' width='25px' height='20px'>";
echo anchor('shopping/remove/' . $item['rowid'], $path);
?>


but the $path is not working for me because it has already double quote , and single quote already

Answer

try this

$path = '<img src="'. base_url("images/cart_cross.jpg").'" width="25px" height="20px">'; 

echo anchor('shopping/remove/' . $item['rowid'], $path);