diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fe079f..7eb3562 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# v1.0.4 +## 07/04/2016 +1 [](#bugfix) + * Fixed Issue #5 - Config not being called statically + # v1.0.3 ## 05/13/2016 1 [](#bugfix) diff --git a/README.md b/README.md index a1aca4d..fa55c76 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Date tools plugin for Grav CMS +*This plugin works with Grav v1.1.0-rc.3 and above.* + This [Grav](http://getgrav.org) plugin provides date tools to use inside of Twig for filtering pages. With the release of Grav 0.9.13 `startDate` and `endDate` were introduced to collection parsing. You can use the following `datetools` to set various dates for retrieving [collections.](http://learn.getgrav.org/content/collections) ## Configuration diff --git a/classes/datetools.php b/classes/datetools.php index 800ce78..719608c 100644 --- a/classes/datetools.php +++ b/classes/datetools.php @@ -57,13 +57,10 @@ class DateTools /** * Construct */ - public function __construct( $grav ) + public function __construct( $args ) { - // get grav - $this->grav = $grav; - // get the config - $this->config = $this->grav['config']; + $this->config = $args['config']; // date format $this->dateFormat = $this->config->get('plugins.datetools.dateFormat.default'); diff --git a/datetools.php b/datetools.php index 80491a6..6627504 100644 --- a/datetools.php +++ b/datetools.php @@ -38,8 +38,11 @@ public function onTwigSiteVariables() { require_once __DIR__ . '/classes/datetools.php'; + $args = []; + $args['config'] = $this->grav['config']; + $twig = $this->grav['twig']; - $twig->twig_vars['datetools'] = new DateTools($this->grav); + $twig->twig_vars['datetools'] = new DateTools($args); } } \ No newline at end of file