Help with planning a CI project

function aboutus($page="aboutus") {
    $this->pages($page); //no need to copy / paste the code, just call the function that has it

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

When I try to visit aboutus/ my SQL output is:

SELECT * FROM (`pages`) WHERE `slug` IS NULL LIMIT 1

Is this right?

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.

Oh, how would I change it?

function aboutus($page) {
Is it a case of checking it the argument is NULL, and if so set it to index?

Sorry again for the hassle, you've helped out sooo much today.

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.

Heh, just clocked your reply at #30. Sorry I missed it Sad

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?

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.

Hehe, I know what you mean Smile
Cool, going to take a look at that shortly.

Totally chuffed getting the pages working, can't believe how quick it was too Smile 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 Big Grin

Thanks again!

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.