Welcome Guest, Not a member yet? Register   Sign In
master template / theme folder location
#1

[eluser]newbiewcoder[/eluser]
Hi guys,

Based on some miracle reasons, my bos want to place master template folder called 'TEMPLATE' like this:

my_ci_app
-application
-system
-TEMPLATE
--template_folder_name
---images
----header.png
---template.php
---style.css
-javascript
index.php

You know, this master template will be used as placeholder for many small widget, ex:calendar, last-comment etc. So, how i can call this master template like $this->load->view('master_template_directory', $data);

And luckily we still use "old-not supported by Phil Sturgeon - modular extension HMVC" Smile

So, how i could realize this purpose?
Or there are any structure advice?

Thanks
#2

[eluser]ram4nd[/eluser]
you can put template folder in views, no point to put it next to core files
#3

[eluser]Buso[/eluser]
you can place a view anywhere, but then before using it you have to modify the view path
Code:
$this->load->_ci_view_path = APPPATH . 'TEMPLATE/';
$this->load->view('my_cool_template');
#4

[eluser]newbiewcoder[/eluser]
@Buso: Does that mean I can not use the original view folder? Templates folder just to save a master template, while other sections of the view is still stored in the original view folder.
#5

[eluser]Buso[/eluser]
I suppose the template is the last view you call, so that shouldn't be a problem

Anyway you can write a method for this, which sets the template path, loads the template, and then sets the original path.

Or you could even extend the Loader class and modify the view() method, so it does that for any view that begins with 'template/'




Theme © iAndrew 2016 - Forum software by © MyBB