Created
February 19, 2019 21:24
-
-
Save animaux/b327312c0977bb39c99a552368eb67fa to your computer and use it in GitHub Desktop.
Symphony CMS Custom Datasource. Displays next month as param in the param pool.
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 | |
require_once(TOOLKIT . '/class.datasource.php'); | |
class datasourcenext_month extends Datasource{ | |
function about(){ | |
return array( | |
'name' => 'Next Month', | |
'author' => array( | |
'name' => 'Alexander Rutz', | |
'website' => 'http://animaux.de'), | |
'version' => '0.1', | |
'release-date' => '2017-05-02T12:00:00+00:00'); | |
} | |
function grab(array &$param_pool = null){ | |
$year = Frontend::instance()->Page()->_param['this-year']; | |
$month = Frontend::instance()->Page()->_param['this-month']; | |
$date = mktime( 0, 0, 0, $month, 1, $year ); | |
$next_month = strftime('%m', strtotime( '+1 month', $date )); | |
$next_months_year = strftime('%Y', strtotime( '+1 month', $date )); | |
$param_pool['next-month'] = $next_month; | |
$param_pool['next-months-year'] = $next_months_year; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment