CodeIgniter Forums

Full Version: I can not access application via uri class
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Unknown[/eluser]
:cheese: Ok Im straight off the boat today.

Problem is that I can not get output as is suggested in hello world video tutorial.

so e.g. :

class Snore extends Controller
{
function hello (){echo "Hello World";}
}

index.php/classname/ will not output hello world

until I declare function in uri

index.php/classname/function/ works.

Is this correct?

El Forum

[eluser]Seppo[/eluser]
By the falt, it will look for the index method. So you have to do

Code:
class Snore extends Controller
{
  function Snore() {
    parent::Controller();
  }

  function index(){
    echo “Hello World”;
  }
}
and access to index.php/snore or index.php/snore/index

El Forum

[eluser]Michael Wales[/eluser]
Code:
class Snore extends Controller
{
function hello (){echo “Hello World”;}
}

To access that the URL would be: yourserver/index.php/snore/hello