CodeIgniter Forums
I can not access application via uri class - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: I can not access application via uri class (/thread-5283.html)



I can not access application via uri class - El Forum - 01-15-2008

[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?


I can not access application via uri class - El Forum - 01-15-2008

[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


I can not access application via uri class - El Forum - 01-15-2008

[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