Configure a New Service

Video loading...

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:09
    The service container
  • 0:10
    is the magician's hat of Drupal.
  • 0:12
    It's full of useful objects.
  • 0:14
    I mean, services.
  • 0:16
    Sorry, forgot
  • 0:17
    that we're trying to sound sophisticated.
  • 0:19
    By default the container is filled with cool stuff
  • 0:22
    like a logger factory,
  • 0:23
    a translator, a little cute white rabbit,
  • 0:25
    and a database connection,
  • 0:09
    O service container (contâiner de serviços)
  • 0:10
    é o chapéu mágico do Drupal.
  • 0:12
    É cheio de objetos úteis.
  • 0:14
    Quer dizer, services.
  • 0:16
    Desculpe, me esqueci
  • 0:17
    que estamos tentando soar sofisticados.
  • 0:19
    Por padrão o container é cheio de coisas legais
  • 0:22
    como uma fábriga de logs,
  • 0:23
    um tradutor, um pequeno coelho fofinho,
  • 0:25
    e uma conexão com o banco de dados,

Configure a New Service

Loading...

Now that we've created a service, let's configure it. In this tutorial, you'll learn how to register your new service. We'll also be using Drupal Console to ensure everything is working as it should.

Note: The Drupal Console command `container:debug` has been changed to `debug:container`.