Skip to content

Instantly share code, notes, and snippets.

@designermonkey
Created October 4, 2010 15:32
Show Gist options
  • Save designermonkey/609887 to your computer and use it in GitHub Desktop.
Save designermonkey/609887 to your computer and use it in GitHub Desktop.
<?php
require_once(TOOLKIT.'/class.event.php');
Class eventcomma_separate extends Event {
public $eParamFILTERS = array(
);
public static function about() {
return array(
'name' =>'Comma separate $_GET params',
'author' => array( 'name' => 'John Porter',
'website' => 'http://designermonkey.co.uk',
'email' => '[email protected]'
),
'version' => '0.1',
'release-date' => '2010-10-04'
);
}
public static function allowEditorToParse() {
return false;
}
public static function documentation() {
return '';
}
public function load() {
$trigger = false;
foreach($_GET as $getParam) {
if (is_array($getParam)) $trigger = true;
}
if ($trigger) return $this -> __trigger();
}
protected function __trigger() {
$page = Frontend::instance() -> Page();
foreach($_GET as $key => $value) {
if (is_array($value)) {
$page->_param['url-'.$key] = join(',', $value);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment