Welcome Guest, Not a member yet? Register   Sign In
Place template folder out of application, using HMVC
#1

[eluser]TomTom[/eluser]
Hi all,

I'm sorry if the question sounds dumb, I'm a total beginner and don't know if this is possible, or if it's a good idea at all. I have a fresh install of Codeigniter and I'm using HMVC with two modules, backend and frontend. I want to create a folder outside of application, in the site root, name it public and host themes and backend-themes folders in it. Like so:
Quote:siteroot
--application
----modules
-------backend
-------frontend
--public
----backend-themes
----themes
--system
Basically, I would like to somehow override the module's views folder and from controllers load a file at 'siteurl/public/themes/themefolder/index.php' as view. Is that possible at all? If it is, what are pros and cons? Thanks in advance.

EDIT: Will this addon help: http://getsparks.org/packages/template/show
#2

[eluser]jvk22[/eluser]
You need to edit the find() function in application/third_party/MX/Modules.php
#3

[eluser]TomTom[/eluser]
Thanks for the reply jvk22. I'd just like to know two more things: how do I do it, so that I keep the existing functionality? For example, I still want my application to look for the files in /application/modules/modulename/views and /application/views and only if they don't exist there, look for it in /public/ folder.

Also, is there a way to add a feature to choose different views folders for different modules?




Theme © iAndrew 2016 - Forum software by © MyBB