<?php /** * I assume the image name comes from a database * so this will probably be filled by a resultset */ $my_image = 'my_image.jpg'; $some_var = $this->config->item('img_base') . $my_image; echo anchor(‘rent’,img($some_var)); ?>