Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smarty like template Pools #58

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Smarty like template Pools #58

wants to merge 8 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Dec 24, 2012

Supports smarty like template pools and loading from specific pool

after setting the search path array to somethink like this

array(
"pool1" => "errorpages/",
"pool16" => "templates9/"
)

for example fetch a template with the filename "[pool16]index.html"

and it will look in the pool16 directory for the file first.
If no [poolname] is given it will normally look through all directories just as it was before.

IJMacD and others added 5 commits May 4, 2012 00:25
context.php:
    Allow accessing first, second or third elements from an array
    Access does not depend on array keys being [0,1,2,3...]
filters.php:
    Access second or third index from items
    Added json filter
    Limiting words could sometimes cut an html tag in half
tags.php:
    Allow start index in {% for %} tag
Supports smarty like tmeplate pools and loading from specific pool

after setting the search path like this
array(
"pool1" => "errorpages/",
"pool16" => "templates9/"
)

for example fetch a template with the filename "[pool16]index.html"

and it will look in the pool16 directory for the file first
@speedmax
Copy link
Owner

why don't you specify both as search path (errorpages/ and /templates9)

@ghost
Copy link
Author

ghost commented Jan 5, 2013

What happens if the file exists in both directorys?
I have a addon system and each addon has a template dir. There will often be identical template names like view.tpl - settings.tpl. I wont get the correct file if a can't tell which dir should be used.

@speedmax
Copy link
Owner

speedmax commented Jan 5, 2013

Shouldn't they be specify in the actually template itself.

extends "path1/template"
extends "path2/template"

Or provide the load path in order you wish

Sent from my iPhone

On 05/01/2013, at 10:11 AM, Dragonbleapiece [email protected] wrote:

What happens if the file exists in both directorys?
I have a addon system and each addon has a template dir. There will often be identical template names like view.tpl - settings.tpl. I wont get the correct file if a can't tell which dir should be used.


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants