Where to set base url in codeigniter 4
- how to get base url in codeigniter
- how to get base url in codeigniter 4
- how to set base url in codeigniter
- how to set base url in codeigniter 4
Base_url codeigniter 3...
How to Get Current URL in Codeigniter?
Sometimes, we need to get current URL path in your controller file or view file.
So, we can get simply using "url" helper. Codeigniter provide url helper library that way we can get existing page url or base url etc.
current_url() through we can get current url in your Codeigniter application.
Redirect base url in codeigniter
But, you should load "url" helper before use current_url(). you can load url helper as bellow:
In bellow example, you can see code how can i get current url in your controller file. So, let's see.
$currentURL = current_url();
print_r($currentURL);
I hope it can help you...
Enjoyed it?
Help us by sharing...
Hardik Savani
I'm a full-stack developer, entrepreneur and owner of ItSolutionstuff.com. I live in India and I love to write tutorials and tips that can help to other artisan.
I believe in Hardworking and Consistency.
- how to use base url in codeigniter 4
- how to set base url in codeigniter on localhost