Dispatcher.php
2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<?php
namespace Phalcon\Mvc {
/**
* Phalcon\Mvc\Dispatcher
*
* Dispatching is the process of taking the request object, extracting the module name,
* controller name, action name, and optional parameters contained in it, and then
* instantiating a controller and calling an action of that controller.
*
*<code>
*
* $di = new Phalcon\DI();
*
* $dispatcher = new Phalcon\Mvc\Dispatcher();
*
* $dispatcher->setDI($di);
*
* $dispatcher->setControllerName('posts');
* $dispatcher->setActionName('index');
* $dispatcher->setParams(array());
*
* $controller = $dispatcher->dispatch();
*
*</code>
*/
class Dispatcher extends \Phalcon\Dispatcher implements \Phalcon\Events\EventsAwareInterface, \Phalcon\DI\InjectionAwareInterface, \Phalcon\DispatcherInterface, \Phalcon\Mvc\DispatcherInterface {
const EXCEPTION_NO_DI = 0;
const EXCEPTION_CYCLIC_ROUTING = 1;
const EXCEPTION_HANDLER_NOT_FOUND = 2;
const EXCEPTION_INVALID_HANDLER = 3;
const EXCEPTION_INVALID_PARAMS = 4;
const EXCEPTION_ACTION_NOT_FOUND = 5;
protected $_handlerSuffix;
protected $_defaultHandler;
protected $_defaultAction;
protected $_isExactControllerName;
/**
* Sets the default controller suffix
*
* @param string $controllerSuffix
*/
public function setControllerSuffix($controllerSuffix){ }
/**
* Sets the default controller name
*
* @param string $controllerName
*/
public function setDefaultController($controllerName){ }
/**
* Sets the controller name to be dispatched
*
* @param string $controllerName
*/
public function setControllerName($controllerName, $isExact=null){ }
/**
* Gets last dispatched controller name
*
* @return string
*/
public function getControllerName(){ }
/**
* Throws an internal exception
*
* @param string $message
* @param int $exceptionCode
*/
protected function _throwDispatchException(){ }
/**
* Handles a user exception
*
* @param \Exception $exception
*/
protected function _handleException(){ }
/**
* Possible controller class name that will be located to dispatch the request
*
* @return string
*/
public function getControllerClass(){ }
/**
* Returns the lastest dispatched controller
*
* @return \Phalcon\Mvc\ControllerInterface
*/
public function getLastController(){ }
/**
* Returns the active controller in the dispatcher
*
* @return \Phalcon\Mvc\ControllerInterface
*/
public function getActiveController(){ }
}
}