Welcome Guest, Not a member yet? Register   Sign In
How to use this->index()?
#2

[eluser]Syllean[/eluser]
Code:
<?php
class Blog extends CI_Controller {

public function index()
{
  echo 'Hello World!';
}

public function rtm()
{
  $this->index();
}
}
?>

Quote:In the above example the function name is index(). The "index" function is always loaded by default if the second segment of the URI is empty.

$this->index() will run the index function and as a result echo Hello World!

RTM: http://ellislab.com/codeigniter/user-gui...llers.html


Messages In This Thread
How to use this->index()? - by El Forum - 06-13-2013, 12:13 PM
How to use this->index()? - by El Forum - 06-13-2013, 03:55 PM



Theme © iAndrew 2016 - Forum software by © MyBB