Skip to content

Instantly share code, notes, and snippets.

@alanfluff
Created May 21, 2012 16:40
Show Gist options
  • Save alanfluff/2763197 to your computer and use it in GitHub Desktop.
Save alanfluff/2763197 to your computer and use it in GitHub Desktop.
Flourish
// above opening HTML tag
function flourish_loader( $class_name )
{
// Customize this to your root Flourish directory
$flourish_root = wire('config')->paths->root . 'site/.flourish/';
$file = $flourish_root . $class_name . '.php';
if (file_exists($file)) {
include $file;
}
}
spl_autoload_register( 'flourish_loader', true );
// In the HTML doc
$date1 = new fDate('2008-01-01');
$date2 = new fDate('2008-01-04');
echo $date1->getFuzzyDifference($date2);
// The output
Error Class 'fDate' not found (line 317 of /site/templates/normal.inc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment