| @@ 87-124 (lines=38) @@ | ||
| 84 | } |
|
| 85 | } |
|
| 86 | ||
| 87 | public function preRender() |
|
| 88 | { |
|
| 89 | $output = ''; |
|
| 90 | ||
| 91 | if (!self::$been_run || $this->mod_return) { |
|
| 92 | foreach (self::$pre_render_sources as $type => $values) { |
|
| 93 | $contents = ''; |
|
| 94 | foreach ($values as $v) { |
|
| 95 | if (is_callable($v)) { |
|
| 96 | $contents .= call_user_func($v, $this); |
|
| 97 | } elseif (is_string($v)) { |
|
| 98 | $contents .= $v; |
|
| 99 | } |
|
| 100 | } |
|
| 101 | ||
| 102 | if (!strlen($contents)) { |
|
| 103 | continue; |
|
| 104 | } |
|
| 105 | ||
| 106 | switch ($type) { |
|
| 107 | case 'script': |
|
| 108 | $output .= '<script class="kint-script">'.$contents.'</script>'; |
|
| 109 | break; |
|
| 110 | case 'style': |
|
| 111 | $output .= '<style class="kint-style">'.$contents.'</style>'; |
|
| 112 | break; |
|
| 113 | default: |
|
| 114 | $output .= $contents; |
|
| 115 | } |
|
| 116 | } |
|
| 117 | ||
| 118 | if (!$this->mod_return) { |
|
| 119 | self::$been_run = true; |
|
| 120 | } |
|
| 121 | } |
|
| 122 | ||
| 123 | return $output.'<div class="kint-plain">'; |
|
| 124 | } |
|
| 125 | ||
| 126 | public function postRender() |
|
| 127 | { |
|
| @@ 316-353 (lines=38) @@ | ||
| 313 | } |
|
| 314 | } |
|
| 315 | ||
| 316 | public function preRender() |
|
| 317 | { |
|
| 318 | $output = ''; |
|
| 319 | ||
| 320 | if (!self::$been_run || $this->mod_return) { |
|
| 321 | foreach (self::$pre_render_sources as $type => $values) { |
|
| 322 | $contents = ''; |
|
| 323 | foreach ($values as $v) { |
|
| 324 | if (is_callable($v)) { |
|
| 325 | $contents .= call_user_func($v, $this); |
|
| 326 | } elseif (is_string($v)) { |
|
| 327 | $contents .= $v; |
|
| 328 | } |
|
| 329 | } |
|
| 330 | ||
| 331 | if (!strlen($contents)) { |
|
| 332 | continue; |
|
| 333 | } |
|
| 334 | ||
| 335 | switch ($type) { |
|
| 336 | case 'script': |
|
| 337 | $output .= '<script class="kint-script">'.$contents.'</script>'; |
|
| 338 | break; |
|
| 339 | case 'style': |
|
| 340 | $output .= '<style class="kint-style">'.$contents.'</style>'; |
|
| 341 | break; |
|
| 342 | default: |
|
| 343 | $output .= $contents; |
|
| 344 | } |
|
| 345 | } |
|
| 346 | ||
| 347 | if (!$this->mod_return) { |
|
| 348 | self::$been_run = true; |
|
| 349 | } |
|
| 350 | } |
|
| 351 | ||
| 352 | return $output.'<div class="kint-rich">'; |
|
| 353 | } |
|
| 354 | ||
| 355 | public function postRender() |
|
| 356 | { |
|