1 | <?php |
||
21 | class WidgetController extends Controller |
||
|
|||
22 | { |
||
23 | /** |
||
24 | * @var Widget |
||
25 | */ |
||
26 | protected $widget; |
||
27 | |||
28 | /** |
||
29 | * @var array |
||
30 | */ |
||
31 | private static $allowed_actions = array( |
||
32 | 'editablesegment' |
||
33 | ); |
||
34 | |||
35 | /** |
||
36 | * @param Widget $widget |
||
37 | */ |
||
38 | public function __construct($widget = null) |
||
47 | |||
48 | /** |
||
49 | * @param string $action |
||
50 | * @return string |
||
51 | */ |
||
52 | public function Link($action = null) |
||
63 | |||
64 | /** |
||
65 | * @return Widget |
||
66 | */ |
||
67 | public function getWidget() |
||
71 | |||
72 | /** |
||
73 | * Overloaded from {@link Widget->Content()} to allow for controller / form |
||
74 | * linking. |
||
75 | * |
||
76 | * @return string HTML |
||
77 | */ |
||
78 | public function Content() |
||
82 | |||
83 | /** |
||
84 | * Overloaded from {@link Widget->WidgetHolder()} to allow for controller/ |
||
85 | * form linking. |
||
86 | * |
||
87 | * @return string HTML |
||
88 | */ |
||
89 | public function WidgetHolder() |
||
93 | |||
94 | /** |
||
95 | * Uses the `WidgetEditor.ss` template and {@link Widget->editablesegment()} |
||
96 | * to render a administrator-view of the widget. It is assumed that this |
||
97 | * view contains form elements which are submitted and saved through |
||
98 | * {@link WidgetAreaEditor} within the CMS interface. |
||
99 | * |
||
100 | * @return string HTML |
||
101 | */ |
||
102 | public function editablesegment() |
||
126 | } |
||
127 | |||
135 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.