Annotations.php
2.56 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
<?php
namespace Phalcon\Mvc\Router {
/**
* Phalcon\Mvc\Router\Annotations
*
* A router that reads routes annotations from classes/resources
*
*<code>
* $di['router'] = function() {
*
* //Use the annotations router
* $router = new \Phalcon\Mvc\Router\Annotations(false);
*
* //This will do the same as above but only if the handled uri starts with /robots
* $router->addResource('Robots', '/robots');
*
* return $router;
* };
*</code>
*/
class Annotations extends \Phalcon\Mvc\Router implements \Phalcon\DI\InjectionAwareInterface, \Phalcon\Mvc\RouterInterface {
const URI_SOURCE_GET_URL = 0;
const URI_SOURCE_SERVER_REQUEST_URI = 1;
protected $_handlers;
protected $_processed;
protected $_controllerSuffix;
protected $_actionSuffix;
protected $_routePrefix;
/**
* Adds a resource to the annotations handler
* A resource is a class that contains routing annotations
*
* @param string $handler
* @param string $prefix
* @return \Phalcon\Mvc\Router\Annotations
*/
public function addResource($handler, $prefix=null){ }
/**
* Adds a resource to the annotations handler
* A resource is a class that contains routing annotations
* The class is located in a module
*
* @param string $module
* @param string $handler
* @param string $prefix
* @return \Phalcon\Mvc\Router\Annotations
*/
public function addModuleResource($module, $handler, $prefix=null){ }
/**
* Produce the routing parameters from the rewrite information
*
* @param string $uri
*/
public function handle($uri=null){ }
/**
* Checks for annotations in the controller docblock
*
* @param string $handler
* @param \Phalcon\Annotations\AdapterInterface
*/
public function processControllerAnnotation($handler, $annotation){ }
/**
* Checks for annotations in the public methods of the controller
*
* @param string $module
* @param string $namespace
* @param string $controller
* @param string $action
* @param \Phalcon\Annotations\Annotation $annotation
*/
public function processActionAnnotation($module, $namespace, $controller, $action, $annotation){ }
/**
* Changes the controller class suffix
*
* @param string $controllerSuffix
*/
public function setControllerSuffix($controllerSuffix){ }
/**
* Changes the action method suffix
*
* @param string $actionSuffix
*/
public function setActionSuffix($actionSuffix){ }
/**
* Return the registered resources
*
* @return array
*/
public function getResources(){ }
}
}