Skip to content

How to get base url in CodeIgniter ?

you can get base url of codeIgniter applicatoin with $this->config->base_url();, you can also call base_url(), but to use the function you need to load codeigniter URL helper.

How to load CodeIgniter URL Helper ?

you can load this with in controller constructor or with in the Method

 $this->load->helper('url');

Or you can autoload it by changing application/config/autoload.php

/*
| -------------------------------------------------------------------
|  Auto-load Helper Files
| -------------------------------------------------------------------
|
*/
$autoload['helper'] = array('url');
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments