Welcome Guest, Not a member yet? Register   Sign In
can't get basic tutorial to work
#1

[eluser]lucoweb[/eluser]
hey there,

I'm trying to wrap my mind around the Tutorial − Static pages but I can't get it to work.

I think it's because there's an IF statement:
Code:
if ( ! file_exists('application/views/pages/'.$page.'.php'))
that always returns TRUE because the tutorial never asked me to create a file there in the first place!

also please note that I copied the code word for word. am I missing something? any help is appreciated.


cheers,
Luciano
#2

[eluser]Aken[/eluser]
Quote:Adding logic to the controller

Earlier you set up a controller with a view() method. The method accepts one parameter, which is the name of the page to be loaded. The static page templates will be located in the application/views/pages/ directory.

In that directory, create two files named home.php and about.php. Within those files, type some text − anything you'd like − and save them. If you like to be particularly un-original, try "Hello World!".

Don't just blindly copy and paste the code -- read the user guide and understand what's happening, or you'll never learn anything.
#3

[eluser]lucoweb[/eluser]
oh. guess I raced past the explanation to the code block. my bad.

now I didn't copy and paste the code - I placed Notepad++ side-by-side with Firefox and re-typed the code as I read, so as to stimulate my memory.

on a side note, you could try making your font bigger and adding name-calling to your replies, Piaget. maybe that'll show how M4D your SK1LLZ are.
#4

[eluser]InsiteFX[/eluser]
He did not call you any names! He was just pointing out that you need to read the
CodeIgniter Users Guide very carefully.

#5

[eluser]lucoweb[/eluser]
@InsiteFX thanks for chilling the flame war Smile

I understand I should have been more specific about the "I copied everything" part. also those of you who've never raced past any text on the web, throw the first stone. Wink

nevertheless, I understand that he was trying to help, and I'm grateful because it did help... but his blockquote was bigger than yours and that kinda gives away how blunt he was being.

the "call you names" thing was sarcasm on my behalf, much like referring to him as "Piaget". sorry. I shouldn't have hit back.




Theme © iAndrew 2016 - Forum software by © MyBB