Created
November 4, 2012 22:08
-
-
Save objectivehtml/4013982 to your computer and use it in GitHub Desktop.
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
| public function delegate() | |
| { | |
| $delegate = $this->tag_part(2); | |
| $method = $this->tag_part(3); | |
| $this->EE->TMPL->tagparts[1] = $delegate; | |
| $this->EE->TMPL->tagparts[2] = $method; | |
| return $this->run($delegate); | |
| } | |
| function tag_part($part, $default = FALSE, $boolean = FALSE) | |
| { | |
| if(!isset($this->EE->TMPL->tagparts[(int)$part])) | |
| { | |
| $this->show_error('This \''.$part.'\' is not a valid tagpart.'); | |
| } | |
| $part = $this->EE->TMPL->tagparts[$part]; | |
| if($part === FALSE && $default !== FALSE) | |
| { | |
| $part = $default; | |
| } | |
| else | |
| { | |
| if($boolean) | |
| { | |
| $part = strtolower($part); | |
| $part = ($part == 'true' || $part == 'yes') ? TRUE : FALSE; | |
| } | |
| } | |
| return $part; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment