Can someone help a newbie out? |
[eluser]BenBrah[/eluser]
I followed this http://www.youtube.com/watch?v=gvGymDhY49E Creating Your First Template With CodeIgniter Updated the controller to CI_controller Basically when i go to http://influencearticles.com/index.php/site/about_us It should be calling the about_us.php information and adding it to the middle and again with http://influencearticles.com/index.php/site/contact_us But I'm getting errors on all 3 including just /site Can anyone tell me where i've gone wrong please? Site / Controller Code: <php header Code: <!DOCTYPE html> footer Code: <p>This is the footer</p> about us Code: <p>This is the about us page.</p> and finally contact us page Code: <p>This is the contact us page.</p>
[eluser]CroNiX[/eluser]
You are getting an error when you just go to "site" because you don't have an index method in your Site class, which is what gets loaded if no method is used in the url. Site should be "Site", not "SITE" in your class declaration. CI_Controller, not CI_controller. Your other errors are because you have a semicolon after "data" and are using & where you should be using $ in your variables. You left the $ off of data. Those are very basic php things. Are you sure you are ready for CI? Code: class Site extends CI_Controller {
[eluser]pbflash[/eluser]
What errors are you receiving? I'm guessing it's because of the &data; which should be $data. Try the below code: Code: <php
[eluser]BenBrah[/eluser]
Thanks guys. I've edited the code and its still not doing what it shows in the video and i can't see any errors or mistakes what are causing this. I'll try another tutorial and CroNiX i thought ci would be a good place to start learning? :p
[eluser]CroNiX[/eluser]
If you don't understand the underlying language that CI is written on top of, you will not have a very easy time. It'd be like taking Algebra without knowing basic math. You will have one big learning curve. Can it be done? Sure, but it will be a lot harder than taking things in order. I'm guessing your remaining errors are in your template.php file. What are the actual errors? Also, your opening php tag should be <?php
[eluser]BenBrah[/eluser]
Thanks updated template_php Code: <?php Actual errors... It's failing to bring the pages up at all. When there clearly there load->view('template', $data); } function about_us() { $data['main_content'] = 'about_us'; $this->load->view('template', $data); } } A PHP Error was encountered Severity: Warning Message: Cannot modify header information - headers already sent by (output started at /home/inflscom/public_html/application/controllers/site.php:17) Filename: core/Common.php Line Number: 438 404 Page Not Found The page you requested was not found. <-- how can the page not be found when its blatantly there and i presume being summoned correctly?
[eluser]pbflash[/eluser]
What are the files names of the template, about_us, and contact_us pages?
[eluser]BenBrah[/eluser]
[quote author="pbflash" date="1329875393"]What are the files names of the template, about_us, and contact_us pages?[/quote] about_us.php and contact_us.php?
[eluser]pbflash[/eluser]
What about the template, header, and footer files and where are they saved on the server?
|
Welcome Guest, Not a member yet? Register Sign In |