CodeIgniter Tutorial News section |
I am now studying the News section - user_guide\tutorial\news_section.html - and having to spend many hours trying to understand, and where I expect I should be spending only around an hour on such simple instructions.
(1) The 1st is clear. - Open up the application/models directory and create a new file called News_model.php and add the following code. (2) The 2nd is difficult to understand. - Connect to your database and run the SQL command below. Also add some seed records. - How do I connect to the database and how do I run the SQL command? I assume the command is to be pasted into News_model.php (3) The 3rd is partially clear. - Add the following code to your model. - I assume the code is to be pasted into News_model.php (4) The 4th is partially clear. - Create the new controller at application/controllers/News.php. - I assume the code is to be pasted into News.php (5) The 5th is difficult to understand. - The next thing to do is passing this data to the views. - I assume the code is to be pasted into News.php (6) The 6th is clear. - Create application/views/news/index.php and add the next piece of code. (7) The 7th is difficult to understand. - Go back to the news controller and update view() with the following: - I assume the code is to be pasted into News.php but don't understand why there are 2 loads. (8) The 8th is clear. - The only things left to do is create the corresponding view at application/views/news/view.php. Put the following code in this file. (9) The 9th is clear. - Modify your routing file (application/config/routes.php) so it looks as follows. After following those instructions and assumptions, and pointing my browser to http://localhost/MyProject/index.php/news I can only get an error page - The website cannot display the page - HTTP 500 This is the code in my News_model.php page Code: <?php Code: <?php I have tried many variations, and now exhausted, and need guidance. Can anybody help? |
Welcome Guest, Not a member yet? Register Sign In |