| @@ 77-110 (lines=34) @@ | ||
| 74 | } |
|
| 75 | } |
|
| 76 | ||
| 77 | public function preRender() |
|
| 78 | { |
|
| 79 | $output = ''; |
|
| 80 | ||
| 81 | if (!self::$been_run || $this->return_mode) { |
|
| 82 | foreach (self::$pre_render_sources as $type => $values) { |
|
| 83 | $contents = ''; |
|
| 84 | foreach ($values as $v) { |
|
| 85 | $contents .= call_user_func($v, $this); |
|
| 86 | } |
|
| 87 | ||
| 88 | if (!strlen($contents)) { |
|
| 89 | continue; |
|
| 90 | } |
|
| 91 | ||
| 92 | switch ($type) { |
|
| 93 | case 'script': |
|
| 94 | $output .= '<script class="kint-script">'.$contents.'</script>'; |
|
| 95 | break; |
|
| 96 | case 'style': |
|
| 97 | $output .= '<style class="kint-style">'.$contents.'</style>'; |
|
| 98 | break; |
|
| 99 | default: |
|
| 100 | $output .= $contents; |
|
| 101 | } |
|
| 102 | } |
|
| 103 | ||
| 104 | if (!$this->return_mode) { |
|
| 105 | self::$been_run = true; |
|
| 106 | } |
|
| 107 | } |
|
| 108 | ||
| 109 | return $output.'<div class="kint-plain">'; |
|
| 110 | } |
|
| 111 | ||
| 112 | public function postRender() |
|
| 113 | { |
|
| @@ 331-364 (lines=34) @@ | ||
| 328 | } |
|
| 329 | } |
|
| 330 | ||
| 331 | public function preRender() |
|
| 332 | { |
|
| 333 | $output = ''; |
|
| 334 | ||
| 335 | if (!self::$been_run || $this->return_mode) { |
|
| 336 | foreach (self::$pre_render_sources as $type => $values) { |
|
| 337 | $contents = ''; |
|
| 338 | foreach ($values as $v) { |
|
| 339 | $contents .= call_user_func($v, $this); |
|
| 340 | } |
|
| 341 | ||
| 342 | if (!strlen($contents)) { |
|
| 343 | continue; |
|
| 344 | } |
|
| 345 | ||
| 346 | switch ($type) { |
|
| 347 | case 'script': |
|
| 348 | $output .= '<script class="kint-script">'.$contents.'</script>'; |
|
| 349 | break; |
|
| 350 | case 'style': |
|
| 351 | $output .= '<style class="kint-style">'.$contents.'</style>'; |
|
| 352 | break; |
|
| 353 | default: |
|
| 354 | $output .= $contents; |
|
| 355 | } |
|
| 356 | } |
|
| 357 | ||
| 358 | if (!$this->return_mode) { |
|
| 359 | self::$been_run = true; |
|
| 360 | } |
|
| 361 | } |
|
| 362 | ||
| 363 | return $output.'<div class="kint-rich">'; |
|
| 364 | } |
|
| 365 | ||
| 366 | public function postRender() |
|
| 367 | { |
|