Welcome Guest, Not a member yet? Register   Sign In
Is the template folder needed for the tutorial?
#1

Hi,

In the CodeIgniter tutorial, specifically at

https://www.codeigniter.com/userguide3/t...pages.html

, the instructions say to create the page header and footer in the

   ../application/views/templates folder.


, it doesn't mention creating the templates folder.  It just says to put the files in that folder.


The problem is that the CodeIgniter 3 distribution doesn't have a templates folder.  
It has only the parent folder,

   ../application/views


So the directive on that page, to point the browser to


[your-site-url]index.php/pages/view



, doesn't work.  It returns a 404.  I assume it's because CodeIgniter isn't using that templates folder, 
where the header and footer are located.


It also returns a 404, if I copy the header.php and footer.php files from the templates folder back into
it's parent views folder.


Summary, long story short: I think the tutorial is mistaken, when it instructs the student to using the ../views/templates folder.


Regards,
Reply
#2

I think the tutorial expects you to create the templates folder.
Reply
#3

(02-04-2019, 10:46 AM)ciadmin Wrote: I think the tutorial expects you to create the templates folder.

Yes, I did so, and also fixed a couple of typos in my files.  It's all working as expected, now.



But note that earlier in the official tutorial, they say that they aren't using templates for the purposes of this tutorial.


So I'm not sure if the template folder references were intentional for version 3 ; or if they are a carryover from tutorials for previous versions.


In either case, they should explicitly ask the user to create the folders, imo.
Reply
#4

Hmmm. I didn't think it used the template parser, though it does use a folder called "templates" ... two different things.
Reply
#5

(02-04-2019, 01:30 PM)ciadmin Wrote: Hmmm. I didn't think it used the template parser, though it does use a folder called "templates" ... two different things.

Sure, that's fine.  But it could be confusing to php novices.  And anyway the main point was the absence of instructions to create the templates folder, almost as if it were assumed they were already there.

A minor issue, and I've already been through the tutorial, so I'll end this thread here.

Thanks for your input and regards,
Reply
#6

FYI, that has been explicitly addressed in the CI4 tutorial -> trying to make things as clear as possible Smile
Reply




Theme © iAndrew 2016 - Forum software by © MyBB