Arbit - project tracking

Dwoo

#69: Extends with absolute path?

Issue revisions

  • new by strato1986 at 2010-A-28 2:56
  • closed by Jordi Boggiano at 2011-F-15 0:22
Type bug bug
State closed closed
Priority high high
Resolution fixed fixed
Assigned to Nobody
Scheduled for
Affected versions 1.1.1
Affected components Plugins
Last change Tuesday 15 February 2011 00:22:48 UTC by Jordi Boggiano

Short description

Extends should support absolute path to the template

Environment

Codeigniter 1.7.2

Steps to reproduce

Put a controller inside a folder ("controllers/foo/bar.php") in the Index method call a template that extends another in its root path ("views/layout.tpl"), so it should be {extends "../layout"}

Expected behavior

http://host/foo/bar => works fine http://host/foo/bar/anotherfunction => should work too

Actual behavior

http://host/foo/bar/anotherfunction => does not work because it loads the template, but cant find the layout.tpl in the views folder (the only way is changing to {extends ../../layout.tpl})

  • Jordi Boggiano at Saturday 8 May 2010 18:28:23 UTC

    The template path shouldn't be related to the URL? I'm not familiar with CodeIgniter so I'm not sure what you mean here, but template paths for {extends} should be relative to the template that contains the {extends} call.

    For example:

    • a/foo.tpl

    • b/bar.tpl

    foo.tpl contains: {extends "../b/bar.tpl"}

    If this does not work can you provide more details or create an archive of all the directories/templates involved and attach it to the issue?