CodeIgniter Forums
Problem with 'Hello World' - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Problem with 'Hello World' (/showthread.php?tid=44108)



Problem with 'Hello World' - El Forum - 08-03-2011

[eluser]ammtar[/eluser]
This is my first contact with framework. with CI too, of course.
I downloaded CI, unpacked in MAMP, started first tutorial, "Hello World" - and got white screen!?!?!?!? No error but the screen, view source as well, is empty.

Not so promising beginning :-(

1. unpacked zip and renamed to ci
2. moved ci to htdocs (MAMP)
3. in "controllers" created file "site.php", as said in tutorial
4.
Code:
class Site extends Controller
{
    function index()
    {
       echo "Hello World";
    }
}

5. open browser: localhost/ci
I'm getting "Welcome to CodeIgniter" message

6. opening localhost/ci/index.php/site/index, as it said in tutorial, and - nothing. Empty page. View source is empty too.

If my version of CI and version of CI used in the video tutorial are not "compatible" where to find correct on? What I supposed to do before?

Thanks for any help.

Afan


Problem with 'Hello World' - El Forum - 08-03-2011

[eluser]Mirge[/eluser]
Turn on error reporting, or view your error log


Problem with 'Hello World' - El Forum - 08-03-2011

[eluser]tomcode[/eluser]
Since CI 2.0, You need to extend CI_Controller instead of Controller

Code:
class Site extends CI_Controller
{
    function index()
    {
       echo "Hello World";
    }
}

edit: Use the user guide bundled with the distribution, a lot of tutorials available still refer to CI 1.* versions, CI 2.* has some fundamental changes


Problem with 'Hello World' - El Forum - 08-03-2011

[eluser]danmontgomery[/eluser]
or use http://ellislab.com/codeigniter/user-guide/toc.html, which is up to date.


Problem with 'Hello World' - El Forum - 08-03-2011

[eluser]ammtar[/eluser]
[quote author="tomcode" date="1312405070"]Since CI 2.0, You need to extend CI_Controller instead of Controller

Code:
class Site extends CI_Controller
{
    function index()
    {
       echo "Hello World";
    }
}

edit: Use the user guide bundled with the distribution, a lot of tutorials available still refer to CI 1.* versions, CI 2.* has some fundamental changes[/quote]

yup... that's it...

thanks.