Closed prakash closed 12 years ago
Are all your template files in APPPATH.views
? If they are in a module's views
directory there seems to me some inconsistency as to whether it works or not (and it shouldn't work at all!). For now, is putting all the view files in directories off APPPATH.views
an acceptable workaround? Or you could bypass Kohana views altogether, get hold of a Smarty object with View::smarty()
and use absolute paths? Global view variables should still be visible.
But I will fix it some day...
yes below is my application views structure
application/views/ - default - layouts - core.tpl - index.tpl
in core.tpl I have following code as a placeholder
{block name="content"}{/block}
and in index.tpl
{extends file="layouts/core.tpl"} {block name="content"} if you can view it, then it's working :) {/block}
and finally, the error:
I think you want
{extends file="default/layouts/core.tpl"}
because include/extends paths are relative to the (array of) paths in $_template_path, not relative to the current template.
I have just pushed a fix that correctly adds the module paths so {include}d and {extend}ed templates should be found in any views
directory (as long as you have the path within the directory correct! :D
so is this fix in addition with supporting latest smarty version included on master?
Yes it is, and tagged 0.9.4
while using {extends} tags on tpl file I am getting an exception error