Beispiel #1
0
 /**
  * Helper method to create a route based on the module name and the route and params.
  * 
  * @param string $moduleName The ID of the module, which should be found inside the nav items.
  * @param string $route      The route for the url rules
  * @param array  $params     The parameters for the url rule
  *
  * @throws Exception
  *
  * @return string
  *
  * @see \luya\helpers\Url::toModule()
  */
 public static function toModuleRoute($moduleName, $route, array $params = [])
 {
     $model = NavItem::findNavItem($moduleName);
     if ($model) {
         return static::toMenuItem($model['id'], $route, $params);
     }
     throw new Exception("The module route creation could not find the module '{$moduleName}', have you created a page with this module in this langauge context?");
 }