public function attachLoader(LoaderInterface $loader, $key = '')
    {
        if (empty($key)) {
            $this->loaders[] = $loader;
        } else {
            $this->loaders[$key] = $loader;
        }
    }
public function attachLoader(LoaderInterface $loader, $key = '')
    {
        if (empty($key)) {
            $this->loaders[] = $loader;
        } else {
            $this->loaders[$key] = $loader;
        }
    }
public function attachLoader ( LoaderInterface $ loader , $ key = '' ) { if ( empty ( $ key ) ) { $ this -> loaders [ ] = $ loader ; } else { $ this -> loaders [ $ key ] = $ loader ; } }
Adds given loader to registry.

@param LoaderInterface $loader
@param string $key
Adds given loader to registry .