public function HookMenu::__construct in Drupal 7 to 8/9 Module Upgrader 8
Constructs a HookMenu object.
Parameters
\Drupal\drupalmoduleupgrader\TargetInterface $target: The target module.
\Drupal\Component\Plugin\PluginManagerInterface $route_converters: The route converters.
File
- src/
Routing/ HookMenu.php, line 63
Class
- HookMenu
- This class is a conversion map for hook_menu().
Namespace
Drupal\drupalmoduleupgrader\RoutingCode
public function __construct(TargetInterface $target, PluginManagerInterface $route_converters) {
$this->target = $target;
$this->routeConverters = $route_converters;
// If the hook_menu() implementation doesn't exist, get the implementation
// from the indexer and eval it into existence. It's the calling code's
// responsibility to ensure that the implementation doesn't contain anything
// which will blow up on execution.
$hook = $target
->id() . '_menu';
if (!function_exists($hook)) {
eval($target
->getIndexer('function')
->get('hook_menu')
->getText());
}
}