Titel
Old | New |
---|
1 | | 1 | How To Create A Backend Widget |
---|
Permalink
Old | New |
---|
1 | | 1 | how_to_create_a_backend_widget |
---|
Inhoud
Old | New |
---|
| | 1 | # How To Create a Backend Widget |
---|
1 | | 2 | |
---|
| | 3 | Backend widgets are boxes of content that are displayed in the backend |
---|
| | 4 | dashboard. Widgets are plug 'n play, meaning that if you upload a |
---|
| | 5 | widget folder it is automatically loaded. A widget is defined by a |
---|
| | 6 | folder named .widget at the end e.g. admin/mywidget.widget/. Inside the |
---|
| | 7 | folder you need to create a configuration file config.inc.php that |
---|
| | 8 | defines the widget and the file to load. See below for an example. |
---|
| | 9 | |
---|
| | 10 | ```php admin/mywidget.widget/config.inc.php |
---|
| | 11 | |
---|
| | 12 | return [ |
---|
| | 13 | 'name' => 'My App', |
---|
| | 14 | 'file' => 'widget.inc.php', // The file to load that is holding the content |
---|
| | 15 | 'priority' => 0, |
---|
| | 16 | ]; |
---|
| | 17 | ``` |
---|
| | 18 | |
---|
| | 19 | ```php admin/mywidget.widget/widget.inc.php |
---|
| | 20 | |
---|
| | 21 | Hello World |
---|
| | 22 | |
---|
| | 23 | Lorem ipsum dolor |
---|
| | 24 | ``` |
---|
| | 25 | |
---|
| | 26 | ## See Also |
---|
| | 27 | |
---|
| | 28 | * [How to Create An Admin App](how_to_create_an_admin_app) |
---|
Geredigeer deur litecart op 29 Des. 2023 om 04:28