Welcome Guest, Not a member yet? Register   Sign In
Template Library Version 1.4
#91

[eluser]tdktank59[/eluser]
Allright after setting it up and getting the basic templte working I ran into a few other problems with ME.

First off, its only looking in the views folder... We need to make it look in the modules/{module}/views folder as well as views/
#92

[eluser]Colin Williams[/eluser]
Ah... you're right. It does that to validate if the file exists... I should just let views do that validation. Try just taking out the file_exists checks and see if that works (however, write_view() needs to check for existence for the cascade to work....)
#93

[eluser]tdktank59[/eluser]
Nope...

the problem is the way you have it setup it goes and looks for it in the views folder... It needs to also check the modules folder if its there...

Which is the trickier part....
#94

[eluser]tdktank59[/eluser]
Never mind...

Works fine, Was trying to use welcome/welcome instead of welcome/welcome_message

Ill post back if I notice any other problems
#95

[eluser]Colin Williams[/eluser]
I think the trickier part will be the write_view and parse_view stuff, since it also runs file checks there in order to resolve the cascade of suggested views.
#96

[eluser]tdktank59[/eluser]
It all works...

http://offroadwars.com/index.php/welcome

for proof...

Dont judge it lol im still working on it...
#97

[eluser]tdktank59[/eluser]
So I kept playing with it yesterday

Just a few notes of advice...

When linking to files within the template make sure they are global links, meaning add the www.yourdomain.com/

Otherwise say you use CI's form validation where it adds an error box. It breaks the link that might have been ../assets/css/style.css and makes it not work. Since you end up "moving" to another folder within the CI code base...

Update:

Found this should work...
<?=$this->config->item('base_url');?>
Code:
<link href="<?=$this->config->item('base_url');?>assets/public/css/examplestyle.css" rel="stylesheet" type="text/css" />

=====================================
I also have a feature request.
When you define default values in the config file it would be nice if we could load controllers/views...
Say to load up a navigation bar? or some values from the database.
Just a few ideas...
#98

[eluser]Colin Williams[/eluser]
Quote:When linking to files within the template make sure they are global links, meaning add the http://www.yourdomain.com/

This should be done whether you use Template or not. And CI has a good function for doing this as part of the URL helper: site_url('path')

Quote:When you define default values in the config file it would be nice if we could load controllers/views…
Say to load up a navigation bar? or some values from the database.

What I think is a better approach is to do this in other, more relevant bootstrapping processes, and not the Template class constructor.
#99

[eluser]tdktank59[/eluser]
Yeah i hate how I post something and then by the time you reply i've come to another solution...

Well mainly in this case our project needs a master controller to handle everything... which solves this problem.

[eluser]Colin Williams[/eluser]
Haha.. I'm just glad you have the foresight, but I'd be patient if you did not. That's a good way to solve it, in a parent controller, because it's still contextually relevant.




Theme © iAndrew 2016 - Forum software by © MyBB