加载bundle时加载路由

I have an API bundle that I load only if I'm on a subdomain, here is what I have in my AppKernel :

if ($_SERVER['HTTP_HOST'] == 'api.mywebsite.fr')
{
    $bundles[] = new TV\ApiBundle\TVApiBundle();
}

Now I need somewhere in my bundle to load it's own routes, without having to modify app/config/routing.yml file with my bundle configuration. I tried to use a custom router loader as explained here http://symfony.com/doc/current/cookbook/routing/custom_route_loader.html but the problem is that part of the tutorial :

AcmeDemoBundle_Extra:
    resource: .
    type: extra

Is there a way to avoid this configuration ? I want my bundle to be independant, and do all the job without having to modify files in app/config/. (except for the AppKernel part ofc :p)

Regards,

Have you checked the last part of the docs? this part add the resource and type inside your custom loader so that you don't have to do it in the routing.yml. http://symfony.com/doc/current/cookbook/routing/custom_route_loader.html

namespace Acme\DemoBundle\Routing;

use Symfony\Component\Config\Loader\Loader;
use Symfony\Component\Routing\RouteCollection;

class AdvancedLoader extends Loader
{
    public function load($resource, $type = null)
    {
        $collection = new RouteCollection();

        $resource = '@AcmeDemoBundle/Resources/config/import_routing.yml';
        $type = 'yaml';

        $importedRoutes = $this->import($resource, $type);

        $collection->addCollection($importedRoutes);

        return $collection;
    }

    public function supports($resource, $type = null)
    {
        return $type === 'advanced_extra';
    }
}