Welcome Guest, Not a member yet? Register   Sign In
Static Page Tutorial
#1
Question 

I am fairly new to web development but have done a bit of programming in the past.  I manually created a few html and then php sites, however lots of people on various forums suggest using a framework, so I read up about them and  I chose CodeIgniter.

So I am working my way through the documentation and now the tutorial but I have just spent the last 5 minutes puzzling over one part of the "Static Pages" tutorial.
My problem was in the "Adding logic to the controller" section, I didn't find it obvious at all where the code for the view function should be entered?  Confused
Having re-read that section many times I am assuming the view function belongs in the Pages.php controller which was created earlier?

I just wanted to point this out as:
a) I was hoping someone could confirm my assumption
b) hopefully it will help someone else
c) possibly encourage someone to modify the tutorial to clarify that part of the instructions.

Thanks in advance.

Craig
Reply
#2

This section of the documentation is titled "Adding logic to the controller".
Doesn't that ring a bell?
Reply
#3

welcome to codeigniter and the forum where the members like to show off their wit, and if pressed even some wisdom.
that said that the tutorial is showing you one method of creating a very simple template in your view folder. go back over that page and look for where it talks about the header and footer in your view folder. basically anything in the "view" folder is part of the view code and is called by the controller. so hopefully you have figured it out -- otherwise if you still have a question -- post the code you have tried, the error message you got, etc.
Reply
#4

(03-28-2016, 11:00 AM)Wouter60 Wrote: This section of the documentation is titled "Adding logic to the controller".
Doesn't that ring a bell?

Yes, that was the clue that lead me to my conclusion. I thought it was worth pointing out though, as to a beginner (almost the only skill level that will use the tutorial), who may still grasping exactly what a "controller" is, it was not immediately obvious which file the text needed to go in.

I got it working in the end. Thanks. 

Thanks too Kenjis. 

Craig
Reply




Theme © iAndrew 2016 - Forum software by © MyBB