Skip to content

Instantly share code, notes, and snippets.

@firegoby
Created October 2, 2014 22:02
Show Gist options
  • Save firegoby/67f48ec1967e19b6c3c6 to your computer and use it in GitHub Desktop.
Save firegoby/67f48ec1967e19b6c3c6 to your computer and use it in GitHub Desktop.
Timestamp parameter extension for Symphony CMS
<?php
Class extension_timestamp_parameter extends Extension {
public function install() {
}
public function uninstall() {
}
public function getSubscribedDelegates(){
return array(
array(
'page' => '/frontend/',
'delegate' => 'FrontendParamsResolve',
'callback' => '__addParam'
)
);
}
/**
* Add timestamp to parameter pool
*
* @param array $context
* delegate context
*/
public function __addParam($context) {
$context['params']['timestamp'] = getdate()[0];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment