Help with planning a CI project - 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: Help with planning a CI project (/showthread.php?tid=27995) |
Help with planning a CI project - El Forum - 02-28-2010 [eluser]theprodigy[/eluser] Code: function aboutus($page="aboutus") { Help with planning a CI project - El Forum - 02-28-2010 [eluser]theprodigy[/eluser] that just makes sure that $page is always filled with something, even if you don't pass in a parameter. It defaults the $page parameter to "aboutus" if it would otherwise be null Help with planning a CI project - El Forum - 02-28-2010 [eluser]invision[/eluser] When I try to visit aboutus/ my SQL output is: Code: SELECT * FROM (`pages`) WHERE `slug` IS NULL LIMIT 1 Is this right? Help with planning a CI project - El Forum - 02-28-2010 [eluser]theprodigy[/eluser] did you change the aboutus method to what I put? It should default the $page variable to "aboutus" if you don't pass anything in. Help with planning a CI project - El Forum - 02-28-2010 [eluser]invision[/eluser] Oh, how would I change it? Code: function aboutus($page) { Sorry again for the hassle, you've helped out sooo much today. Help with planning a CI project - El Forum - 02-28-2010 [eluser]theprodigy[/eluser] check page 2, last post. You'll see a post with the method (all I changed was the parameter portion of it. And since you are using the aboutus method, you really don't need the route we put into the routes page. I was only giving options of what you could do (one or the other), no need for both. Help with planning a CI project - El Forum - 02-28-2010 [eluser]invision[/eluser] Heh, just clocked your reply at #30. Sorry I missed it Help with planning a CI project - El Forum - 02-28-2010 [eluser]invision[/eluser] Absolutely delighted with the help you've given sir. Just a quick question. Say if I wanted to list all the pages that are in the 'aboutus' section for my 'nav'. How would I best do this? Is it just a case of creating another controller to access all the pages, but limit it to the category_id value in my table? So it would only list pages in the 'about us' section of the site? Help with planning a CI project - El Forum - 02-28-2010 [eluser]theprodigy[/eluser] that all depends on how you have your database setup. When databasing the menu, I usually setup a table strictly for the menu, completely un-related to the other tables. So, if I wanted, I could build pages that can't be accessed via the menu (and vice versa if I'm not careful ;-) ). You can do a google search for easy ways of databasing the menu and how to do recursive methods to pull all the data out that you need. Help with planning a CI project - El Forum - 02-28-2010 [eluser]invision[/eluser] Hehe, I know what you mean Cool, going to take a look at that shortly. Totally chuffed getting the pages working, can't believe how quick it was too You're a star. In the meantime, I'm going to work on the navigation and news area of the site. I may be back Thanks again! |