Created
March 7, 2012 17:34
-
-
Save tylersticka/1994574 to your computer and use it in GitHub Desktop.
Extends Mustache's partial method to fetch from a known file path.
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
<?php | |
class Example extends Mustache { | |
protected function _getPartial($tag_name) { | |
$template_path = "./templates/partials/$tag_name.mustache"; | |
if (file_exists($template_path)) { | |
$this->_partials[$tag_name] = file_get_contents($template_path); | |
} | |
return parent::_getPartial($tag_name); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment