Codeigniter - How to get current url in controller or view ?By Hardik Savani | August 2, 2016 | | 9901 Viewer | Category : 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. 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();
- How to quick run any PHP Project?
- Laravel 5 dynamic autocomplete search using select2 JS Ajax - Part 1
- How to use where clause with mysql function in Laravel 5?
- Full Text Search in Laravel 5 Example
- PHP - Input multiple tags with dynamic autocomplete example
- Laravel 5 - Simple CRUD Application Using ReactJS - Part 1
- How to hide div after some time using AngularJS?
- How to remove comma from string in jquery with example ?