Codeigniter - How to get current url in controller or view ?By Hardik Savani | August 2, 2016 | | 4004 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();
- Jquery tooltip example code with demo using Jquery UI
- How to get current controller or method name in Codeigniter ?
- Simple Add remove input fields dynamically using jquery with Bootstrap
- How to integrate stripe payment gateway in Laravel 5.4 Application ?
- Laravel 5 - How to prevent browser back button after user logout?
- How to get last inserted id in laravel 5?
- How to copy one table data into another table using Mysql Query?
- Codeigniter 3 - Generate PDF from view using dompdf library with example