(Totally new to CodeIgniter and php, not new to programming)

In CodeIgniter, how or where can I declare an array that will be accessible in the router (CI_Router), in my custom controller and in the view loader (CI_Loader)? I want to avoid hard-coding data in the router and specifying the same data more than once (in the router and in the controller and/or view).

(Explanation follows; perhaps there is a better way to do what I'm trying to do.)

I have a site where I publish my freeware apps. The site is all static, but maintaining plain html by hand is a nightmare, so I'm trying to use CodeIgniter to generate the pages dynamically. Apart from a few loose ends like 'welcome' or 'contact info', the bulk of the site consists of highly structured application sections. Each app has the same set of pages: about, download, screenshots, etc. These pages all have the same exact layout and only differ in contents.

My main concern is maintainability and the amount of work that required to add a new app (or a new page for all apps). I see no reason to use multiple controllers (or even multiple views), because the only difference is in data (application identifiers), not in behavior or page layout.

My problem is with routing. I could do something like

$route['app1'] = 'main/apps/app1';
$route['app2'] = 'main/apps/app2';


...or loop over an array of app identifiers, but that seems really bad. When I add an application, I should not have to modify the router, since it's just another identifier added to a list, that will be used to pick page contents from an appropriate file.

What I would like to do instead is (pseudocode):

foreach (app in list_of_apps) {
  foreach (app_page in list_of_pages) {
    route['app/app_page'] = 'main/index/app/app_page'
  }
}


This would take care of all requests for 'app1/download' or 'app2/screenshots', etc. So where can I declare the arrays $list_of_apps and $list_of_pages so that they are visible in the router, in the controller, and later in view as well?


Question: how to differentiate between "implication" and" connotation"?
Answer: A connotation can just be an idea that we associate with another word, phrase or sentence. So for example the phrase bucket and spade will have connotations of beaches, sunshine, childhood, seaside holidays and so forth. If you're writer and you want to talk about a grave-robber stealing a body from a cemetery, you probably won't want to say:


He picked up his bucket and spade ...


There's nothing wrong with the grammar of this sentence, but when you say bucket and spade it might make people think about happy things, not grave, serious and scary ones. It's probably important for your story for people to be a little bit scared, not happy and comfortable. Notice that nobody would think that the grave-robber was at the beach in that sentence. It is just that using that phrase will make people think about beaches for a second.

An implication is something slightly different. If I imply something, I am saying something specific to somebody, without actually using that sentence (this might be an accident. We might not want the listener to have this idea). Usually, an implication is a proposition -  something that can be expressed as a sentence. So for example, if I say:


If you don't do your homework, you won't get any ice cream.


... then I am implying that:


If you do your homework you will get some ice-cream.


But notice that I did not say that. That second sentence is not part of what I said. If I am a mean and horrible person, I may have deliberately tricked you. But I did not lie. The truth may well be that:


If you don't do your homework you won't get any ice-cream and if you do do your homework, you still won't get any ice-cream.


The reason might be for example, that you are not allowed ice-cream because you're allergic to dairy products. Notice that if I say the whole of the last example, the implication is cancelled. We no longer think that the speaker will give any ice-cream to anyone if the homework is done. We can cancel implications easily. It is difficult to cancel connotations. We may still be reminded of something, like holidays, for example, even if the actual word or phrase is being used in a completely different way.

Conclusion

In the normal uses of these words, a connotation is an association that we have with a word, phrase or sentence. It is not necessarily a proposition. It is not usually the kind of idea we can express in a sentence.

In contrast, an implication is usually a proposition. It is an idea we could express as a sentence. Sometimes the listener may want us to understand this proposition. Sometimes it may be accidental. We can cancel implications. It is difficult, if not impossible sometimes, to cancel connotations.