Welcome Guest, Not a member yet? Register   Sign In
Calling img src and alt from database
#7

(10-23-2017, 08:45 AM)InsiteFX Wrote:
PHP Code:
/**
 * asset ()
 * ------------------------------------------------------------------------
 *
 * Assumes that all resources are in a asset directory in the root
 * along with index.php. Place in ./application/helpers in a file.
 *
 * USAGE in VIEW:
 *
 * <?php echo asset('path/filename.ext'); ?>
 */
if ( ! function_exists('asset'))
{
    
/**
     * asset ()
     * -------------------------------------------------------------------
     *
     * @param  $uri
     * @return mixed
     */
    
function asset($uri)
    {
        
$CI get_instance();

        return 
$CI->config->base_url('assets/'.$uri);
    }


Hi InsiteFX,

Thanks for this - I think it will be very useful as I have quite a lot of views to do!

Best regards,

Alan
Reply


Messages In This Thread
Calling img src and alt from database - by alann - 10-16-2017, 02:23 AM
RE: Calling img src and alt from database - by alann - 10-24-2017, 04:35 AM



Theme © iAndrew 2016 - Forum software by © MyBB