Welcome Guest, Not a member yet? Register   Sign In
Easiest Way to Handle Multiple View Styles?
#1

[eluser]Aea[/eluser]
I'm working on a site right now where I want to have two view styles, one for normal pages, and one "minimal" view for inclusion in javascript modal windows.

What would be the best way to pass a variable to every single controller so I could get around this issue?
#2

[eluser]gtech[/eluser]
If the template is select by the user,
the easiest way to store and retrieve variables that are available across page requests is to use the session library, this is well documented in the CI documentation.

if the template is selected by a permanent config value then take a look at the config class:
[url="http://ellislab.com/codeigniter/user-guide/libraries/config.html"]http://ellislab.com/codeigniter/user-guide/libraries/config.html[/url]
You can add your own variables to the config/config.php file
#3

[eluser]Aea[/eluser]
I'm sorry, I must have explained it in a confusing manner. I want to pass an variable (as simple as /m/ or the lack of it) within the context of the url, and I want to know what the easiest way to get it across all sorts of controllers would be (obviously without setting it up as a controller variable for every function).
#4

[eluser]wiredesignz[/eluser]
Take a look at the URI Language Identifier library, it provides an automatic key that is added to all site_url()'s and could be easily modified to suit your application.
#5

[eluser]Aea[/eluser]
Thank you, that was exactly what I was looking for Smile




Theme © iAndrew 2016 - Forum software by © MyBB