@@ 13-45 (lines=33) @@ | ||
10 | * @author PyroCMS, Inc. <[email protected]> |
|
11 | * @author Ryan Thompson <[email protected]> |
|
12 | */ |
|
13 | class GetOutput |
|
14 | { |
|
15 | ||
16 | /** |
|
17 | * The widget extension. |
|
18 | * |
|
19 | * @var WidgetInterface |
|
20 | */ |
|
21 | protected $widget; |
|
22 | ||
23 | /** |
|
24 | * Create a new GetOutput instance. |
|
25 | * |
|
26 | * @param WidgetInterface $widget |
|
27 | */ |
|
28 | public function __construct(WidgetInterface $widget) |
|
29 | { |
|
30 | $this->widget = $widget; |
|
31 | } |
|
32 | ||
33 | /** |
|
34 | * Handle the output. |
|
35 | * |
|
36 | * @param Factory $view |
|
37 | * @return \Illuminate\Contracts\View\View |
|
38 | */ |
|
39 | public function handle(Factory $view) |
|
40 | { |
|
41 | $extension = $this->widget->getExtension(); |
|
42 | ||
43 | return $view->make($extension->getWrapper(), ['widget' => $this->widget]); |
|
44 | } |
|
45 | } |
|
46 |
@@ 13-45 (lines=33) @@ | ||
10 | * @author PyroCMS, Inc. <[email protected]> |
|
11 | * @author Ryan Thompson <[email protected]> |
|
12 | */ |
|
13 | class SetContent |
|
14 | { |
|
15 | ||
16 | /** |
|
17 | * The widget extension. |
|
18 | * |
|
19 | * @var WidgetInterface |
|
20 | */ |
|
21 | protected $widget; |
|
22 | ||
23 | /** |
|
24 | * Create a new SetContent instance. |
|
25 | * |
|
26 | * @param WidgetInterface $widget |
|
27 | */ |
|
28 | public function __construct(WidgetInterface $widget) |
|
29 | { |
|
30 | $this->widget = $widget; |
|
31 | } |
|
32 | ||
33 | /** |
|
34 | * Handle the output. |
|
35 | * |
|
36 | * @param Factory $view |
|
37 | * @return \Illuminate\Contracts\View\View |
|
38 | */ |
|
39 | public function handle(Factory $view) |
|
40 | { |
|
41 | $extension = $this->widget->getExtension(); |
|
42 | ||
43 | $this->widget->setContent($view->make($extension->getView(), ['widget' => $this->widget])); |
|
44 | } |
|
45 | } |
|
46 |