1 | <?php |
||
26 | class CamelizeActionName extends Plugin |
||
27 | { |
||
28 | /** |
||
29 | * Specifies the delimiter to use at the conclusion of all dispatching to ensure view paths properly resolve. |
||
30 | * |
||
31 | * @var string |
||
32 | */ |
||
33 | private $uncamelizeDelimiter; |
||
34 | |||
35 | /** |
||
36 | * IndexRedirectorPlugin constructor. |
||
37 | * |
||
38 | * @param string $uncamelizeDelimiter Specifies the delimiter to use at the conclusion of all dispatching |
||
39 | * to ensure view paths properly resolve. |
||
40 | */ |
||
41 | public function __construct($uncamelizeDelimiter = '-') |
||
45 | |||
46 | /** |
||
47 | * Triggered before the dispatch loop begins. |
||
48 | * |
||
49 | * Note: The default value for the dispatcher action name is an empty string. We no longer need to |
||
50 | * check for cases where the action could be <tt>null</tt>. |
||
51 | * |
||
52 | * @param \Phalcon\Events\Event $event The beforeDispatchLoop event. |
||
53 | * @param \Phalcon\Mvc\Dispatcher $dispatcher The application dispatcher instance. |
||
54 | */ |
||
55 | public function beforeDispatchLoop(Event $event, Dispatcher $dispatcher) |
||
59 | |||
60 | /** |
||
61 | * In order for views to respect the uncamelized directory structure the action name must |
||
62 | * be converted back into an uncamelized form. |
||
63 | * |
||
64 | * Note: Until \Phalcon\Text::uncamelize() supports variable delimiter we manually use hyphens. |
||
65 | * |
||
66 | * @link https://github.com/phalcon/cphalcon/issues/10396 |
||
67 | * |
||
68 | * @param \Phalcon\Events\Event $event The beforeDispatchLoop event. |
||
69 | * @param \Phalcon\Mvc\Dispatcher $dispatcher The application dispatcher instance. |
||
70 | */ |
||
71 | public function afterDispatchLoop(Event $event, Dispatcher $dispatcher) |
||
76 | } |
||
77 |