-
Notifications
You must be signed in to change notification settings - Fork 146
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
Configurable paths #7
Comments
Guys, any ideas on how to call that config ? I'm gonna make it a function that transforms the filepath into the cache key. By default, it's gonna be identity... |
So you could pass in another function, which could transform the key in an arbitrary way? That could work. Alternately, the main use-case I see for this is the one we ran into, where your templates are loaded w/ a root-relative URL path. In that context, all we would need is the ability to specify a prefix to be appended to the cache key, similar to The former is more flexible, while the latter is simpler. |
prefix to basePath would be simpler... but sometimes it's not enough... (you might want to remove some prefix as well) eg. you have directory |
So I think, there are two options, I definitely wanna keep it simple. 1/ a transform function that takes the filepath (relative to basePath) and returns the $templateCache key, by default, it's identity function 2/ |
I'd vote for # 1 (transformation function), it seems to be the most explicit. |
The path - cache key needs to be configurable.
The text was updated successfully, but these errors were encountered: