Welcome Guest, Not a member yet? Register   Sign In
url and config
#1

[eluser]wojtekk[/eluser]
i made in config dir web.php
Code:
<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');
    $CI =& get_instance();
    $CI->load->helper('url');
    
    $config['dir_images'] = base_url().'images/';
?>

and in autoload.php
Code:
$autoload['config'] = array('web');

i did it like that because i dont think u should put anything more to config.php
i just want in one place directory (so icould change it easily) and just call
Code:
$this->config->item('dir_images')

I saw Assets Helper
but
structure of dirs on all pages not always the same
so
Code:
$config['dir_images'] = 'images/';
or
Code:
$config['dir_images'] = '/images/';
is correct

so add base_url() to link is the best solution
Correct me if im wrong and maybe there is other better solution




Theme © iAndrew 2016 - Forum software by © MyBB