CodeIgniter Forums
Changing View's Dir - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Changing View's Dir (/showthread.php?tid=14052)



Changing View's Dir - El Forum - 12-16-2008

[eluser]walrus_lt[/eluser]
Hello, i want to add feature wich allows to use different views depending of selected template.

I't should look like this:

views/DarkShades/index.php
views/DarkShades/forum.php
views/Wap/index.php
views/Wap/forum.php


Doe's codeigniter allow change views dir, easily? And how? Smile


Changing View's Dir - El Forum - 12-16-2008

[eluser]xwero[/eluser]
Code:
$this->load->view($theme.'/index.php');



Changing View's Dir - El Forum - 12-16-2008

[eluser]walrus_lt[/eluser]
IT's only the way? Smile Seems that i will need write my own code :cheese:


Changing View's Dir - El Forum - 12-16-2008

[eluser]xwero[/eluser]
I don't see why you need to write your own code? It's just a directory that needs to be added in front of the view file. You can add the directory to the config or to the session.


Changing View's Dir - El Forum - 12-16-2008

[eluser]walrus_lt[/eluser]
It would be more portable. But you'r right Smile


Changing View's Dir - El Forum - 12-24-2008

[eluser]jaswinder_rana[/eluser]
Sorry to hack this thread but how will I store different CSS and JS files?


Changing View's Dir - El Forum - 12-24-2008

[eluser]garrettheel[/eluser]
css and js files should be stored in the webroot anyway, not the view directories


Changing View's Dir - El Forum - 12-24-2008

[eluser]jaswinder_rana[/eluser]
Thanks.

I do understand and that's the problem. If I have different themes for views then it means I need to crate similar directory structure for each theme's CSS and JS?

Views is in system and has been organized with directory structure for themes.

assets are in public_html and has to have similar directory structure for each theme, right?

I was hoping to avoid that if there is another solution but it seems not.