Welcome Guest, Not a member yet? Register   Sign In
path instead of baseurl
#1

[eluser]markos151[/eluser]
Hi

I'm new to CI ( great work, thx) an have following problem:
I don't like use full url "http://www.mydomain.com/mypath/images/a.jpg" within links
I want use "/mypath/images/a.jpg".

I need function like:

function baseurl_path(){
$base= base_url();
$f= '/.*'.$_SERVER['SERVER_NAME'].'/';
$b= preg_replace($f, '', $base);
return b;
}
Can I find it in CI or not?

regards
markos151
#2

[eluser]esra[/eluser]
Keep in mind that CodeIgnitor is a framework or basic foundation for building your own applications. You can extend and expand the framework as you see fit to meet your development requirements.

You might consider making a copy of url_helper.php and call it something like links_helper.php. Then add your own path or url functions as desired. If you need more defines (constants), you could include something like a defines.php file in index.php right after the code where APPPATH is defined.




Theme © iAndrew 2016 - Forum software by © MyBB