That did the job!!  Thanks : $route['(:any)'] = "main";

My Approach is very simple.  There is three types of data.  1) Home page, 2) 
category pages, and 3) content pages.

So all I need to do is read the URL and determine which it is and pull that 
content and populate the template.

I will probably add one more layer of functionality.  That would be to check if 
there is a template specifically for that particular content.  

Pretty simple approach.

Thank you for your help!! 

------------------------

Keith Smith

--- On Sun, 2/19/12, Eric Cope <[email protected]> wrote:

From: Eric Cope <[email protected]>
Subject: Re: CodeIgnigniter Config Question
To: "Main PLUG discussion list" <[email protected]>
Date: Sunday, February 19, 2012, 11:19 PM

Hey Keith,

You can address this multiple ways. One way is mod_rewrite. Obviously this is 
outside of CodeIgniter. Another way is to define custom Routes 
(http://codeigniter.com/user_guide/general/routing.html).  



I personally recommend against one monolithic controller. I've found that if 
your controller is more than about a page of code, its failing DRY principles, 
difficult to refactor, difficult to test, etc. This is not always the case, but 
a decent generalization. Then again, if you can leverage models, libraries, and 
views, and still only have about a page of controller code, then go for it.



Eric

On Sun, Feb 19, 2012 at 9:58 PM, keith smith <[email protected]> wrote:



Hi,

I'm looking at CodeIgniter.  I would like to change the way it works a little 
bit.  

URL's will take on this pattern:



MyDomain.tld = is the index

MyDomain.tld/page-name (stand alone page)


MyDomain.tld/cat1/catn (one or more categories) (display the last category)

MyDomain.tld/cat1/catn/article-page  (one or more categories then an article 
page) (display article)


I would like to read the URL in a main controller.  There would only be one 
controller.  I would break the URL into its arguments and decide what Model and 
View to load and display. 

Is it possible to configure CodeIgniter to function this way?



Thanks in advance!

------------------------

Keith Smith
---------------------------------------------------

PLUG-discuss mailing list - [email protected]

To subscribe, unsubscribe, or to change your mail settings:

http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss



-----Inline Attachment Follows-----

---------------------------------------------------
PLUG-discuss mailing list - [email protected]
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
---------------------------------------------------
PLUG-discuss mailing list - [email protected]
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss

Reply via email to