Closed hailwood closed 12 years ago
Sorry it has taken so long to respond, I've had no time to work on CI Smarty, however I am working on a solution for this as we speak.
Hello Vheissu, I've got the same problem, when I try to {include file='myfile.tpl'} it's trying to find it only in /application/views.
Do you think you are able to fix library in next few days/weeks?
Regards,
@willczek1981 I have a temporary solution that I posted on StackOverflow: http://stackoverflow.com/questions/11111396/using-smarty-3-code-igniter-2-and-hmvc-together-with-smartys-inheritance
Hey, Thank you alot! I will check this out.
Regards, Wilczek
-----Original Message----- From: Matthew Hailwood [mailto:reply@reply.github.com] Sent: Tuesday, July 10, 2012 11:51 AM To: willczek1981 Subject: Re: [Ci-Smarty] Smarty Inheritance does not play nicely with HMVC (#18)
@willczek1981 I have a temporary solution that I posted on StackOverflow: http://stackoverflow.com/questions/11111396/using-smarty-3-code-igniter-2-and-hmvc-together-with-smartys-inheritance
Reply to this email directly or view it on GitHub: https://github.com/Vheissu/Ci-Smarty/issues/18#issuecomment-6871159
This solution works quite well, at least for my current needs :) Thank you.
I have done significant work on making HMVC functionality better. Please give it a go and let me know if it works better for you.
I am using Code Igniter, The HMVC library, and Smarty with this library.
Smarty is working fine by default, however if I try to use smarty's inheritance feature (
{extends file="master.tpl"}
) then we run into an issue.The extends feature does not look in the module views folder for the extended file (in the above's case
master.tpl
), instead it only looks in theapplication/views/
folder and throws an error if it cannot find it.I could add
APPPATH."modules/smartytest/views"
to the$config['template_directory']
array in the smarty config file. but that throws an error for each item in the array it checks first for the file.filemtime(): stat failed for application/views/master.tpl
and that has the added issue of, if I have three modules all the the array and the modules all have a master.tpl then no matter what module I call the extend from it will load the first one found.
So, is there a way to get smarty's extend function to behave nicely with the HMVC modules?