Codeigniter - How to get current url in controller or view ?By Hardik Savani | August 2, 2016 | | 950 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();
- How to create authentication(login and registration) in Laravel 5.2?
- PHP - Getting Started PHPUnit test with simple example
- How to get current url with query string in codeigniter?
- How to install laravel framework on windows xampp server from scratch?
- How to create Pagination using dirPagination directive in Angularjs example with demo ?
- How to get year, month and day from timestamp date using carbon in Laravel 5?
- How to get last inserted id in laravel 5?
- Laravel 5 - where condition with two columns example code