File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<?php namespace NumenCode \Widgets \Components ;
22
33use Cms \Classes \ComponentBase ;
4+ use NumenCode \Fundamentals \Traits \RenderingHelpers ;
45
56class Counters extends ComponentBase
67{
8+ use RenderingHelpers;
9+
710 public $ counters ;
811
912 public function componentDetails (): array
Original file line number Diff line number Diff line change 22
33use Cms \Classes \ComponentBase ;
44use NumenCode \Widgets \Models \FeatureGroup ;
5+ use NumenCode \Fundamentals \Traits \RenderingHelpers ;
56
67class Features extends ComponentBase
78{
9+ use RenderingHelpers;
10+
811 public $ group ;
912
1013 public function componentDetails (): array
@@ -38,28 +41,11 @@ public function onRun()
3841 $ this ->group = $ this ->loadGroup ();
3942 }
4043
41- public function onRender ()
42- {
43- if (!$ layout = $ this ->property ('layout ' )) {
44- $ layout = 'default ' ;
45- }
46-
47- return $ this ->renderPartial ('@ ' . $ layout . '.htm ' );
48- }
49-
5044 public function getTitleOptions (): array
5145 {
5246 return FeatureGroup::lists ('title ' , 'id ' );
5347 }
5448
55- public function getLayoutOptions (): array
56- {
57- return [
58- 'default ' => 'Default ' ,
59- 'media ' => 'Default with pictures ' ,
60- ];
61- }
62-
6349 protected function loadGroup ()
6450 {
6551 return FeatureGroup::find ($ this ->property ('title ' ));
Original file line number Diff line number Diff line change 22
33use Cms \Classes \ComponentBase ;
44use NumenCode \Widgets \Models \GalleryGroup ;
5+ use NumenCode \Fundamentals \Traits \RenderingHelpers ;
56
67class Gallery extends ComponentBase
78{
9+ use RenderingHelpers;
10+
811 public $ gallery ;
912 public $ itemsPerRow ;
1013
@@ -47,27 +50,11 @@ public function onRun()
4750 $ this ->itemsPerRow = $ this ->property ('items_per_row ' ) ?? 4 ;
4851 }
4952
50- public function onRender ()
51- {
52- if (!$ layout = $ this ->property ('layout ' )) {
53- $ layout = 'default ' ;
54- }
55-
56- return $ this ->renderPartial ('@ ' . $ layout . '.htm ' );
57- }
58-
5953 public function getTitleOptions (): array
6054 {
6155 return GalleryGroup::lists ('title ' , 'id ' );
6256 }
6357
64- public function getLayoutOptions (): array
65- {
66- return [
67- 'default ' => 'Default ' ,
68- ];
69- }
70-
7158 protected function loadGallery ()
7259 {
7360 return GalleryGroup::find ($ this ->property ('title ' ));
Original file line number Diff line number Diff line change 22
33use Cms \Classes \ComponentBase ;
44use NumenCode \Widgets \Models \HighlightGroup ;
5+ use NumenCode \Fundamentals \Traits \RenderingHelpers ;
56
67class Highlights extends ComponentBase
78{
9+ use RenderingHelpers;
10+
811 public $ group ;
912
1013 public function componentDetails (): array
@@ -38,27 +41,11 @@ public function onRun()
3841 $ this ->group = $ this ->loadGroup ();
3942 }
4043
41- public function onRender ()
42- {
43- if (!$ layout = $ this ->property ('layout ' )) {
44- $ layout = 'default ' ;
45- }
46-
47- return $ this ->renderPartial ('@ ' . $ layout . '.htm ' );
48- }
49-
5044 public function getTitleOptions (): array
5145 {
5246 return HighlightGroup::lists ('title ' , 'id ' );
5347 }
5448
55- public function getLayoutOptions (): array
56- {
57- return [
58- 'default ' => 'Default ' ,
59- ];
60- }
61-
6249 protected function loadGroup ()
6350 {
6451 return HighlightGroup::find ($ this ->property ('title ' ));
Original file line number Diff line number Diff line change 22
33use Cms \Classes \ComponentBase ;
44use NumenCode \Widgets \Models \PromotionGroup ;
5+ use NumenCode \Fundamentals \Traits \RenderingHelpers ;
56
67class Promotions extends ComponentBase
78{
9+ use RenderingHelpers;
10+
811 public $ group ;
912
1013 public function componentDetails (): array
@@ -38,27 +41,11 @@ public function onRun()
3841 $ this ->group = $ this ->loadGroup ();
3942 }
4043
41- public function onRender ()
42- {
43- if (!$ layout = $ this ->property ('layout ' )) {
44- $ layout = 'default ' ;
45- }
46-
47- return $ this ->renderPartial ('@ ' . $ layout . '.htm ' );
48- }
49-
5044 public function getTitleOptions (): array
5145 {
5246 return PromotionGroup::lists ('title ' , 'id ' );
5347 }
5448
55- public function getLayoutOptions (): array
56- {
57- return [
58- 'default ' => 'Bootstrap 4 ' ,
59- ];
60- }
61-
6249 protected function loadGroup ()
6350 {
6451 return PromotionGroup::find ($ this ->property ('title ' ));
File renamed without changes.
You can’t perform that action at this time.
0 commit comments