public function internalCreateUrl($params, $composition = null)
    {
        $params = (array) $params;
        
        $composition = empty($composition) ? $this->getComposition() : $composition;
        
        $originalParams = $params;
        
        // prepand the original route, whether is hidden or not!
        // https://github.com/luyadev/luya/issues/1146
        $params[0] = $composition->prependTo($params[0], $composition->createRoute());
        
        $response = parent::createUrl($params);

        // Check if the parsed route with the prepand composition has been found or not.
        if (strpos($response, rtrim($params[0], '/')) !== false) {
            // we got back the same url from the createUrl, no match against composition route.
            $response = parent::createUrl($originalParams);
        }

        $response = $this->removeBaseUrl($response);
        $response = $composition->prependTo($response);

        return $this->prependBaseUrl($response);
    }
public function internalCreateUrl($params, $composition = null)
    {
        $params = (array) $params;
        
        $composition = empty($composition) ? $this->getComposition() : $composition;
        
        $originalParams = $params;
        
        // prepand the original route, whether is hidden or not!
        // https://github.com/luyadev/luya/issues/1146
        $params[0] = $composition->prependTo($params[0], $composition->createRoute());
        
        $response = parent::createUrl($params);

        // Check if the parsed route with the prepand composition has been found or not.
        if (strpos($response, rtrim($params[0], '/')) !== false) {
            // we got back the same url from the createUrl, no match against composition route.
            $response = parent::createUrl($originalParams);
        }

        $response = $this->removeBaseUrl($response);
        $response = $composition->prependTo($response);

        return $this->prependBaseUrl($response);
    }
public function internalCreateUrl ( $ params , $ composition = null ) { $ params = ( array ) $ params ; $ composition = empty ( $ composition ) ? $ this -> getComposition ( ) : $ composition ; $ originalParams = $ params ; // prepand the original route, whether is hidden or not! // https://github.com/luyadev/luya/issues/1146 $ params [ 0 ] = $ composition -> prependTo ( $ params [ 0 ] , $ composition -> createRoute ( ) ) ; $ response = parent :: createUrl ( $ params ) ; // Check if the parsed route with the prepand composition has been found or not. if ( strpos ( $ response , rtrim ( $ params [ 0 ] , '/' ) ) !== false ) { // we got back the same url from the createUrl, no match against composition route. $ response = parent :: createUrl ( $ originalParams ) ; } $ response = $ this -> removeBaseUrl ( $ response ) ; $ response = $ composition -> prependTo ( $ response ) ; return $ this -> prependBaseUrl ( $ response ) ; }
Yii2 createUrl base implementation extends the prepand of the comosition

@param string|array $params An array with params or not (e.g. `['module/controller/action', 'param1' => 'value1']`)
@param null|\luya\web\Composition $composition Composition instance to change the route behavior
@return string
Yii2 createUrl base implementation extends the prepand of the comosition