Codeigniter - How to get current url in controller or view ?By Hardik Savani | August 2, 2016 | | 789 Viewer | Category : Codeigniter
Share this post:
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. 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();
- Laravel 5 select with sum query example
- Ajax Image Upload Example with Validation in PHP Laravel Framework
- Laravel tokenmismatchexception in verifycsrftoken.php - Solved
- Bootstrap year picker example using datepicker js
- Laravel 5.2 chat message module using socket.io, redis, express and nodejs from from scratch.
- Laravel after login, redirect back to previous url ?
- Laravel 5 - How to get route parameters in your route middleware?
- Laravel 5 login with Linkedin using Socialite Package