Created
July 22, 2011 13:36
-
-
Save johndwells/1099473 to your computer and use it in GitHub Desktop.
Allow EE plugin to be called statically from PHP
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
// Taken from the guts of Stash: https://github.com/croxton/Stash | |
// is this method being called statically from PHP? | |
if (func_num_args() > 0 && !(isset($this) && get_class($this) == __CLASS__)) | |
{ | |
$this->EE->TMPL->tagparams['name'] = $name; | |
$this->EE->TMPL->tagparams['type'] = $type; | |
$this->EE->TMPL->tagparams['scope'] = $scope; | |
// as this function is called statically, | |
// we need to get an instance of this object and run get() | |
$self = new self(); | |
return $self->get(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment