-
-
Save kinglozzer/fe08af4db771df1acb3a2690e96a03cd to your computer and use it in GitHub Desktop.
This file contains 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 | |
class MyTemplateProvider implements TemplateGlobalProvider { | |
/** | |
* @return array | |
*/ | |
public static function get_template_global_variables() { | |
return array( | |
'CurrentURL' => 'get_current_url' | |
); | |
} | |
/** | |
* @return string | |
*/ | |
public function get_current_url() { | |
return Controller::curr()->request->getURL(true); | |
} | |
} | |
// dev/build, then use in template with {$CurrentURL} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment