Created
July 17, 2014 19:02
-
-
Save saltybeagle/a9e0b554cbb6605699f6 to your computer and use it in GitHub Desktop.
Savvy versioning ideas
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Versioning for savvy templated projects, so template files fallback to previous versions if no newer version exists | |
Template directories on filesystem: | |
templates/jsonv1 | |
templates/jsonv2 | |
templates/jsonv3 | |
$_SERVER['REQUEST_URI'] = 'v2/blah.json'; | |
while ($version > 0) { | |
$savant->addTemplatePath('templates/jsonv'.$version); | |
$version--; | |
} | |
$paths = range(1, $version); | |
$paths = './templates/jsonv'.implode($paths, ':./templates/jsonv'); | |
$savant->addTemplatePath($paths); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment