core/helpers/Url.php
public static function toAjax($route, array $params = [])
    {
        $routeParams = ['/'.$route];
        foreach ($params as $key => $value) {
            $routeParams[$key] = $value;
        }
        
        return static::toInternal($routeParams, true);
    }
public static function toAjax($route, array $params = [])
    {
        $routeParams = ['/'.$route];
        foreach ($params as $key => $value) {
            $routeParams[$key] = $value;
        }
        
        return static::toInternal($routeParams, true);
    }
public static function toAjax ( $ route , array $ params = [ ] ) { $ routeParams = [ '/' . $ route ] ; foreach ( $ params as $ key => $ value ) { $ routeParams [ $ key ] = $ value ; } return static :: toInternal ( $ routeParams , true ) ; }
Create a link to use when point to an ajax script.

@param string $route  The base routing path defined in yii. module/controller/action
@param array $params Optional array containing get parameters with key value pairing
@return string The ajax url link.
Create a link to use when point to an ajax script .