Skip to content

Instantly share code, notes, and snippets.

View amphibian's full-sized avatar

Derek Hogue amphibian

View GitHub Profile
@amphibian
amphibian / gist:5414609
Created April 18, 2013 17:29
Quick example of one way to deal with Localize class methods which will be deprecated in ExpressionEngine 2.6
<?php
// Backwards-compatibility with pre-2.6 Localize class
$format_date_fn = (version_compare(APP_VER, '2.6', '>=')) ? 'format_date' : 'decode_date';
echo $this->EE->localize->{$format_date_fn}('%Y-%m-%d', $this->EE->localize->now);
// 2013-04-18