ISSO is no longer a product regularly released so we'll remove the issoversion tag...
[isso.git] / RouterController.php
1 <?php
2 /*=====================================================================*
3 || ###################################################################
4 || # Blue Static ISSO Framework
5 || # Copyright ©2002-[#]year[#] Blue Static
6 || #
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version [#]gpl[#] of the License.
10 || #
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 || # more details.
15 || #
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
21
22 /**
23 * Router Controller (RouterController.php)
24 *
25 * @package ISSO
26 */
27
28 require_once('ISSO/Input.php');
29
30 /**
31 * Router Controller
32 *
33 * This is an abstract class used to dispatch responces from the Router.
34 *
35 * @author Blue Static
36 * @copyright Copyright (c)2002 - [#]year[#], Blue Static
37 * @version $Revision$
38 * @package ISSO
39 *
40 */
41 abstract class BSRouterController
42 {
43 /**
44 * The input variables parsed from the URL string and $_POST
45 * @var array
46 */
47 protected $params;
48
49 // ###################################################################
50 /**
51 * Constructor
52 */
53 public function __construct(BSInput $params)
54 {
55 $this->params = $params;
56 }
57
58 // ###################################################################
59 /**
60 * Does nothing if the request was sent via POST, and triggers an
61 * error if it was not
62 */
63 protected function _verifyPostRequest()
64 {
65 if ($this->params->getHttpMethod() != 'post')
66 {
67 trigger_error('Action is intended to be executed from a POST request');
68 }
69 }
70
71 /**
72 * The default action (index)
73 */
74 public abstract function Index();
75 }
76
77 /*=====================================================================*
78 || ###################################################################
79 || # $HeadURL$
80 || # $Id$
81 || ###################################################################
82 \*=====================================================================*/
83 ?>