File tree 2 files changed +26
-17
lines changed
2 files changed +26
-17
lines changed Original file line number Diff line number Diff line change @@ -99,23 +99,7 @@ function kernel_init() {
99
99
try {
100
100
$path = current_path();
101
101
$router->match(base_path() . $path);
102
- $router_item = array(
103
- 'path' => $path,
104
- 'page_callback' => 'kernel_callback',
105
- 'page_arguments' => array(\Symfony\Component\HttpFoundation\Request::createFromGlobals()),
106
- 'delivery_callback' => '',
107
- 'tab_parent' => '',
108
- 'tab_root' => $path,
109
- 'title' => '',
110
- 'type' => MENU_CALLBACK,
111
- 'include_file' => drupal_get_path('module', 'kernel') . '/kernel.pages.inc',
112
- 'href' => $path,
113
- 'tab_root_href' => $path,
114
- 'tab_parent_href' => '',
115
- 'access' => TRUE,
116
- 'original_map' => arg(NULL, $path),
117
- 'map' => arg(NULL, $path),
118
- );
102
+ $router_item = $c['router.transformer']($path);
119
103
120
104
// If the desire is to output a whole Symfony response, use:
121
105
//
Original file line number Diff line number Diff line change @@ -64,5 +64,30 @@ public function register(\Pimple\Container $pimple)
64
64
$ pimple ['router ' ] = function ($ c ) {
65
65
return $ c ['container ' ]->get ('router ' );
66
66
};
67
+ $ pimple ['router.transformer ' ] = $ pimple ->protect (
68
+ /**
69
+ * @param $path
70
+ *
71
+ * @return array
72
+ */
73
+ function ($ path ) {
74
+ return array (
75
+ 'path ' => $ path ,
76
+ 'page_callback ' => 'kernel_callback ' ,
77
+ 'page_arguments ' => array (\Symfony \Component \HttpFoundation \Request::createFromGlobals ()),
78
+ 'delivery_callback ' => '' ,
79
+ 'tab_parent ' => '' ,
80
+ 'tab_root ' => $ path ,
81
+ 'title ' => '' ,
82
+ 'type ' => MENU_CALLBACK ,
83
+ 'include_file ' => drupal_get_path ('module ' , 'kernel ' ) . '/kernel.pages.inc ' ,
84
+ 'href ' => $ path ,
85
+ 'tab_root_href ' => $ path ,
86
+ 'tab_parent_href ' => '' ,
87
+ 'access ' => TRUE ,
88
+ 'original_map ' => arg (NULL , $ path ),
89
+ 'map ' => arg (NULL , $ path ),
90
+ );
91
+ });
67
92
}
68
93
}
You can’t perform that action at this time.
0 commit comments