Created
May 18, 2012 18:32
-
-
Save yusufnb/2726920 to your computer and use it in GitHub Desktop.
Smallest Templating Engine
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 | |
| function view($tmpl, $args) { | |
| $view_dir = 'views/'; | |
| foreach ($args as $k => $v) $$k = $v; | |
| ob_start(); | |
| include ("$view_dir$tmpl.php"); | |
| return ob_get_clean(); | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment