Merge pull request #4091 from MrPetovan/task/4090-add-module-class-routing
[friendica.git/.git] / src / BaseModule.php
1 <?php\r
2 \r
3 namespace Friendica;\r
4 \r
5 /**\r
6  * All modules in Friendica should extend BaseModule, although not all modules\r
7  * need to extend all the methods described here\r
8  *\r
9  * @author Hypolite Petovan mrpetovan@gmail.com\r
10  */\r
11 abstract class BaseModule extends BaseObject\r
12 {\r
13         /**\r
14          * @brief Initialization method common to both content() and post()\r
15          *\r
16          * Extend this method if you need to do any shared processing before both\r
17          * content() or post()\r
18          */\r
19         public static function init()\r
20         {\r
21 \r
22         }\r
23 \r
24         /**\r
25          * @brief Module GET method to display any content\r
26          *\r
27          * Extend this method if the module is supposed to return any display\r
28          * through a GET request. It can be an HTML page through templating or a\r
29          * XML feed or a JSON output.\r
30          *\r
31          * @return string\r
32          */\r
33         public static function content()\r
34         {\r
35                 $o = '';\r
36 \r
37                 return $o;\r
38         }\r
39 \r
40         /**\r
41          * @brief Module POST method to process submitted data\r
42          *\r
43          * Extend this method if the module is supposed to process POST requests.\r
44          * Doesn't display any content\r
45          */\r
46         public static function post()\r
47         {\r
48                 // goaway('module');\r
49         }\r
50 \r
51         /**\r
52          * @brief Called after post()\r
53          *\r
54          * Unknown purpose\r
55          */\r
56         public static function afterpost()\r
57         {\r
58 \r
59         }\r
60 }\r