CodeIgniter Forums

Full Version: Newbie question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi together,
I am new to codeigniter, but not new to php.
So I installed it, tried the first example from the tutorial, and it worked.

Now I walked through the second tutorial (that one with the news)
https://codeigniter.com/user_guide/tutor...ction.html

and at the end it says:
"Point your browser to your document root, followed by index.php/news and watch your news page."

But then I get a 404 error (produced by codeigniter).

Of course I controlled all files in the tutorial, but dont find the error.

How can I find out, where I made a mistake in the tuturial?
Is there somethink like a debug-modus?

Thanks in advance!
Marco
Make sure your routes are correct and also the tutorial is missing
the Success view you need to create that yourself in the views folder.
@MarcoElias,

Have you followed the instructions to the T? Have you checked the error logs? Don't forget that PHP is case sensitive. Is your controller named correctly?
(10-16-2019, 08:29 AM)php_rocs Wrote: [ -> ]@MarcoElias,

Have you followed the instructions to the T?  Have you checked the error logs? Don't forget that PHP is case sensitive.  Is your controller named correctly?

Indeed, case sensitivity was my solution:
I was supposed to create "/application/controllers/News.php", but I created "/application/controllers/news.php".

Not very funny for a beginner to name SOME files with a beginning upper case and some other lower case.

I also was supposed to create "/application/views/pages/home.php" (not Home.php) and "/application/views/pages/about.php" (not About.php).

Confusing and frustrating for me. Plus, I would say, not consequently lowercase.
Why some files upper and other lower?

Another question: If in my environment I want to change every file to be lowercase at the beginning - where will that be done? Does this make sense?

Thanks for helping, thanks for another tip.
Marco
@MarcoElias,

> Confusing and frustrating for me. Plus, I would say, not consequently lowercase.
Why some files upper and other lower?

With static pages, after the URL is $routed to the controller, I personally prefer to prefix the required view page with v-URL.php because the editor file names are easily distinguished from propercase Controller file names.

...my two Satang
@MarcoElias,

Unfortunately you will not be able to change the naming of the files in CI because it is part of the PHP Style Guide: https://codeigniter.com/user_guide/gener...ile-naming .
(10-18-2019, 07:05 AM)php_rocs Wrote: [ -> ]@MarcoElias,

Unfortunately you will not be able to change the naming of the files in CI because it is part of the PHP Style Guide: https://codeigniter.com/user_guide/gener...ile-naming .

Ok, that makes sense, thank you for the link!!!

Now I continue learning CI :-)
Thank you folks,
Marco