Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
A dual path resolution strategy
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Bilge  
View profile  
 More options Oct 1 2012, 7:01 pm
From: Bilge <bbi...@gmail.com>
Date: Mon, 1 Oct 2012 16:01:36 -0700 (PDT)
Local: Mon, Oct 1 2012 7:01 pm
Subject: A dual path resolution strategy

When I first started integrating Twig into my project I was annoyed with
that way that path resolution works when including resources with tags like
include and macro. Paths were always resolved relative to the working
directory of my project so I always had to write out the full path to a
template even if it existed in a single subdirectory of the currently
rendering template. To combat this I decided to automatically change the
working directory to the path of the template being rendered immediately
before calling render(). This strategy worked but now I find myself wanting
to be able to render 'absolute' paths too. Ideally I want to be able to
resolve both relative and 'absolute' paths such that a scheme beginning
with a '/' would be treated as 'absolute' and resolved in the context of my
view script root directory and any other path would be resolved in the
context of the currently rendering template's directory.

What would be the best way to implement this path resolution strategy
within Twig?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bilge  
View profile  
 More options Oct 1 2012, 7:15 pm
From: Bilge <bbi...@gmail.com>
Date: Mon, 1 Oct 2012 16:15:18 -0700 (PDT)
Local: Mon, Oct 1 2012 7:15 pm
Subject: Re: A dual path resolution strategy

I should add that I'm currently not using the default
Twig_Loader_Filesystem that deals with relative paths but a simple
variation that I wrote that loads absolute paths instead because that's
what my application framework provides.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »