![]() |
homepage set... moving on? newb help - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: homepage set... moving on? newb help (/showthread.php?tid=30176) |
homepage set... moving on? newb help - El Forum - 05-05-2010 [eluser]Unknown[/eluser] so, i have my homepage and loading the templates. now, i'm trying to get a second page (about us) working. not sure how to go about doing that... here is my controller thus far (as of right now, i'm not using a database) Code: class Home extends Controller { so i assume i would use the same controller and just add to it. i basically want an "about us" page that uses a different template (i understand how to set the template using the view loader). also confused about the url structure needed to access this page. ideally i just want "index.php/about" if someone could break this down for me i would GREATLY appreciate it. homepage set... moving on? newb help - El Forum - 05-05-2010 [eluser]danmontgomery[/eluser] The url structure is: Quote:http://www.mydomain.tld/{controller}/{method}/{parameters}... Where the default method is index(). So, Quote:http://www.mydomain.tld/home Will point to the Home controller, and the index method. To go to about, you would have a method in the Home controller called about(), and the url would be: Quote:http://www.mydomain.tld/home/about If you want to remove home from that url, you'd need to use custom routing. You can read about routing (and the above) at http://ellislab.com/codeigniter/user-guide/general/routing.html homepage set... moving on? newb help - El Forum - 05-05-2010 [eluser]Bart v B[/eluser] So, the second parameter you can make a new function: Code: class Home extends Controller { |