public static function toModuleRoute($moduleName, array $route)
    {
        $item = Yii::$app->menu->find()->where(['module_name' => $moduleName])->with(['hidden'])->one();
        
        if ($item) {
            return static::toMenuItem($item->id, $route);
        }

        throw new Exception("The module route creation could not find the module '$moduleName'. Have you created a page with this module in this language context?");
    }
public static function toModuleRoute($moduleName, array $route)
    {
        $item = Yii::$app->menu->find()->where(['module_name' => $moduleName])->with(['hidden'])->one();
        
        if ($item) {
            return static::toMenuItem($item->id, $route);
        }

        throw new Exception("The module route creation could not find the module '$moduleName'. Have you created a page with this module in this language context?");
    }
public static function toModuleRoute ( $ moduleName , array $ route ) { $ item = Yii :: $ app -> menu -> find ( ) -> where ( [ 'module_name' => $ moduleName ] ) -> with ( [ 'hidden' ] ) -> one ( ) ; if ( $ item ) { return static :: toMenuItem ( $ item -> id , $ route ) ; } throw new Exception ( "The module route creation could not find the module '$moduleName'. Have you created a page with this module in this language context?" ) ; }
Helper method to create a route based on the module name and the route and params.

Use the route as defined in the modules' $urlRules array in order to generate the URL according
to the rules' pattern. Example:

```php
Url::toModuleRoute('blog', ['/blog/default/index', 'year' => 2016, 'month' => '07]);
```

generates the following URL, assuming the blog module is located on the CMS page /my-super-blog:

/my-super-blog/2016/07

according to the following URL rule:

```php
public $urlRules = [
['pattern' => 'blog/<year:\d{4}>/<month:\d{2}>', 'route' => 'blog/default/index'],
];
```

@param string $moduleName The ID of the module, which should be found inside the nav items.
@param string|array $route The route of the module `module/controller/action` or an array like in Url::to with param infos `['/module/controller/action', 'foo' => 'bar']`.
@param array  $params The parameters for the url rule. If the route is provided as an array with params the further defined params or overwritten by the array_merge process.
@throws Exception
@return string
@see \luya\helpers\Url::toModule()
Helper method to create a route based on the module name and the route and params .