| @@ 282-295 (lines=14) @@ | ||
| 279 | * |
|
| 280 | * @return mixed |
|
| 281 | */ |
|
| 282 | protected function renderCustomTools($tools) |
|
| 283 | { |
|
| 284 | return $tools->map(function ($tool) { |
|
| 285 | if ($tool instanceof Renderable) { |
|
| 286 | return $tool->render(); |
|
| 287 | } |
|
| 288 | ||
| 289 | if ($tool instanceof Htmlable) { |
|
| 290 | return $tool->toHtml(); |
|
| 291 | } |
|
| 292 | ||
| 293 | return (string) $tool; |
|
| 294 | })->implode(' '); |
|
| 295 | } |
|
| 296 | ||
| 297 | /** |
|
| 298 | * Render tools. |
|
| @@ 56-69 (lines=14) @@ | ||
| 53 | * |
|
| 54 | * @return string |
|
| 55 | */ |
|
| 56 | public function render() |
|
| 57 | { |
|
| 58 | return $this->tools->map(function ($tool) { |
|
| 59 | if ($tool instanceof Renderable) { |
|
| 60 | return $tool->render(); |
|
| 61 | } |
|
| 62 | ||
| 63 | if ($tool instanceof Htmlable) { |
|
| 64 | return $tool->toHtml(); |
|
| 65 | } |
|
| 66 | ||
| 67 | return (string) $tool; |
|
| 68 | })->implode(' '); |
|
| 69 | } |
|
| 70 | } |
|
| 71 | ||
| @@ 73-83 (lines=11) @@ | ||
| 70 | return ''; |
|
| 71 | } |
|
| 72 | ||
| 73 | return $this->elements[$part]->map(function ($element) { |
|
| 74 | if ($element instanceof Htmlable) { |
|
| 75 | return $element->toHtml(); |
|
| 76 | } |
|
| 77 | ||
| 78 | if ($element instanceof Renderable) { |
|
| 79 | return $element->render(); |
|
| 80 | } |
|
| 81 | ||
| 82 | return (string) $element; |
|
| 83 | })->implode(''); |
|
| 84 | } |
|
| 85 | } |
|
| 86 | ||
| @@ 318-328 (lines=11) @@ | ||
| 315 | return ''; |
|
| 316 | } |
|
| 317 | ||
| 318 | return $tools->map(function ($tool) { |
|
| 319 | if ($tool instanceof Renderable) { |
|
| 320 | return $tool->render(); |
|
| 321 | } |
|
| 322 | ||
| 323 | if ($tool instanceof Htmlable) { |
|
| 324 | return $tool->toHtml(); |
|
| 325 | } |
|
| 326 | ||
| 327 | return (string) $tool; |
|
| 328 | })->implode(' '); |
|
| 329 | } |
|
| 330 | ||
| 331 | /** |
|