<commit_before>Chapter 2. Your First Backend
=============================

Creating your first backend will take you less than 30 seconds. Let's suppose
that your Symfony application defines three Doctrine ORM entities called
``Product``, ``Category`` and ``User``.

Open the ``app/config/config.yml`` file and add the following configuration:

.. code-block:: yaml

    # app/config/config.yml
    easy_admin:
        entities:
            - AppBundle\Entity\Product
            - AppBundle\Entity\Category
            - AppBundle\Entity\User

**Congratulations! You've just created your first fully-featured backend!**
Browse the ``/admin`` URL in your Symfony application and you'll get access to
the admin backend:

.. image:: ../images/easyadmin-default-backend.png
   :alt: Default EasyAdmin Backend interface

Expanded Configuration Format
-----------------------------

This simple backend uses the shortcut configuration format, but for real
backends, you must use the extended configuration syntax instead, which allows
to configure lots of options for each entity:

.. code-block:: yaml

    # app/config/config.yml
    easy_admin:
        entities:
            Customer:
                class: AppBundle\Entity\Customer
            Order:<commit_msg>Added a note about the translation service in the introductory tutorial<commit_after>Chapter 2. Your First Backend
=============================

Creating your first backend will take you less than 30 seconds. Let's suppose
that your Symfony application defines three Doctrine ORM entities called
``Product``, ``Category`` and ``User``.

Open the ``app/config/config.yml`` file and add the following configuration:

.. code-block:: yaml

    # app/config/config.yml
    easy_admin:
        entities:
            - AppBundle\Entity\Product
            - AppBundle\Entity\Category
            - AppBundle\Entity\User

**Congratulations! You've just created your first fully-featured backend!**
Browse the ``/admin`` URL in your Symfony application and you'll get access to
the admin backend:

.. image:: ../images/easyadmin-default-backend.png
   :alt: Default EasyAdmin Backend interface


.. note::

    If the interface of your backend displays translation strings instead of
    the actual contents, make sure that the ``translator`` service is enabled:

    .. code-block:: yaml

        # app/config/config.yml
        framework:
            translator: { fallbacks: [ "en" ] }

Expanded Configuration Format
-----------------------------

This simple backend uses the shortcut configuration format, but for real
backends, you must use the extended configuration syntax instead, which allows
to configure lots of options for each entity:

.. code-block:: yaml

    # app/config/config.yml
    easy_admin:
        entities:
            Customer:
                class: AppBundle\Entity\Customer
            Order:
{'fraction_non_alphanumeric': 0.11670718999652657, 'fraction_numerical': 0.0020840569642236887, 'mean_word_length': 2.876177658142665, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4811129', 'n_tokens_mistral': 740, 'n_tokens_neox': 691, 'n_words': 283}