This file contains 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
/* An HTML template in 180 bytes (minified) | |
Features: Escapes HTML, accepts either strings or functions as values, and that's all (it doesn't handle looping). | |
Usage: | |
OneEightyT( | |
"<h1>{name}</h1><div>{content} @ {currentTime}</div>", | |
{ | |
name: "Stella", |
This file contains 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 Page_Controller extends ContentController{ | |
/** | |
* Require a custom script from a file | |
* @param string $filepath | |
* @param bool $addMinLive - prepend .min to file extension if not in dev mode | |
*/ | |
public function inlineJS($filepath, $addMinLive = true){ | |
if(($addMinLive || $addMinLive != 'false') && !Director::isDev()) $filepath = str_replace('.js', '.min.js', $filepath); |