index page url explanation / uri segments in codeigniter




This is the full and exact link of the codeigniter home page.

http : this is a protocol.
localhost : this is the host name.
CodeIgniter : this is the file in which i copied the codeigniter files.
index.php : this is the model
Welcome : name of the controller
index : function name

We can also get each uri segment from the url

$data=$this->uri->segment(1);
echo $data;

The above code prints "Welcome".

$data=$this->uri->segment(2);
echo $data;

The above code prints "index".





Prev
Next

Comments

Popular posts from this blog

Node.js Cheat Sheet

Codeigniter ! Simple But Powerful

Bootstrap ? What is it ?