Getting HelloWorld CodeIgniter Example

Guys I'm new to code igniter. I do not understand how to use this infrastructure. Its just opened user manual. Can someone tell me the steps I need to follow to execute the hello world program on a code igniter?

+5
source share
4 answers

Make a file with a name hello.phpin the system / application / controllers folder. In the file, put this code:

<?php
class Hello extends Controller
{
   function index()
   {
     echo 'Hello world!';
   }
}
?>

Then go to http://localhost/codeigniter/index.php/helloand you will see the world hello. (Perhaps you placed it in a different directory than codeigniter, so change the URL if necessary).

Then you can change the code to:

<?php
class Hello extends Controller
{
   function index()
   {
     echo 'Hello world!';
   }

   function test()
   {
      echo 'Second hello world!';
   }
}
?>

http://localhost/codeigniter/index.php/hello/test "test" .

.htaccess mod_rewrite, "index.php" URL-, http://localhost/codeigniter/hello http://localhost/codeigniter/hello/test.

+10

IDE.

- , (IDE). IDE ECLIPSe. IDE , mabee / .

- //, , , .

, -, .

+4

My advice is to watch / listen to the video tutorials available here: http://codeigniter.com/tutorials/ and http://video.derekallard.com/ and take notes about them. Should show you how codeigniter works.

+3
source
<html>

<head>
<title>Codeigniter</title>
</head>

<body>

<?php

include "index.php";


class hello extends CI_Controller
{
   function index()
   {
     echo "Hello world!";
   }
}

echo "head<br>";
$t = new hello();
$t->index();
?>

</body>
</html>
0
source

All Articles