Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected function convertDrupalItem($router_item) {
- $route = array(
- '_controller' => $router_item['page_callback']
- );
- // Place argument defaults on the route.
- foreach ($router_item['page_arguments'] as $k => $v) {
- $route['node'] = $v;
- }
- $path = explode('/', $router_item['path']);
- $i = 0;
- foreach ($path as $element_key => $element) {
- if ($element == '%') {
- $path[$element_key] = "{element$i}";
- }
- $i++;
- }
- return new Route(implode('/', $path), $route);
- }
Advertisement
Add Comment
Please, Sign In to add comment