3 // Copyright (c) 2011 Blue Static
5 // This program is free software: you can redistribute it and/or modify it
6 // under the terms of the GNU General Public License as published by the Free
7 // Software Foundation, either version 3 of the License, or any later version.
9 // This program is distributed in the hope that it will be useful, but WITHOUT
10 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 // You should have received a copy of the GNU General Public License along with
15 // this program. If not, see <http://www.gnu.org/licenses/>.
17 namespace hoplite\http
;
20 The RootController is meant to be invoked from the index.php of the
26 Creates the controller with the request context information, typicallhy
27 from the global scope ($GLOBALS), but can be injected for testing.
30 public function __construct($globals)
34 Createst the Request and Response that are used throughout the duration of
41 Prevents any other Actions from executing. This starts the OutputFilter and
44 public function Stop()
48 Invoked by Run() and can be invoked by others to evaluate and perform the
49 lookup in the UrlMap. This then calls InvokeAction().
50 @param string The URL fragment to look up in the
52 public function RouteRequest($url_fragment)
56 Used to run an Action and drive it through its states.
59 public function InvokeAction(Action
$action)
63 Performs a reverse-lookup in the UrlMap for the pattern/fragment for the
64 name of a given Action class.
65 @param string Class name.
67 public function LookupAction($class)