I'm using CI Smarty
https://github.com/Vheissu/Ci-Smarty
There are Two issues with this as far as I have noticed. but the issue for which I opened this question is that I cant load a .tpl
file if that .tpl
file is inside the directory of another directory.
e-g this is my current directory structure for SmartyTemplate
--Themes
--SomeOtherThemeName
--Default //Default Theme Directory I am currently using
--css
--js
--images
--views
--admin (directory)
--sitesettings (directory)
--site-settings.tpl (template file) //This Template file will Not Work
If I move this Template file to parent directory which is admin
, it will work if I call it, but if I call it from inside sitesettings
directory it will not work.
Here is how I call it.
function functionName(){
$data['title']="Some Title";
$this->parser->parse('admin/sitesettings/site-settings.tpl',$this->data);
}
Simply, Smarty Only Allow me to have 1 extra Directory in hierarchy under views folder, I want to know if there is any fix for this so that I can have unlimited or at least more directories in hierarchy so I don't have messed up file system.
update: if anyone wanna see my project coding please go to this GitHub project.
https://github.com/pakistanihaider/HouseRentSystem
Database regarding this project.
http://www.mediafire.com/view/1jp9u906r8i10u0/houserentsystem.sql
Somehow found the main problem thanks to @Sauryabhatt.
I think problem exists in {{extends file='adminLayout.tpl'}}
how do it knows where the file exist, I mean if I move the file inside most inner directory how it will know where the main layout file exit to which it will be a child? do I need to define a path when extending a file?
Update: Also Tried like to define the path to the layout, but seems that it also didn't worked out for me.
$this->parser->parse('extends:layouts/adminLayout.tpl|file:systemConfigurationSitePreferences.tpl',$this->data);
it works if I put the fail in admin directory, but stops working if I move the file inside in another directory of admin directory.