<commit_before>Installation
============

Make sure you have ``Sonata`` and ``Knplabs`` exists, if not create them::

  mkdir src/Sonata
  mkdir src/Knplabs

To begin, add the dependent bundles to the ``src/`` directory. If using
git, you can add them as submodules::

  git submodule add <EMAIL>:sonata-project/jQueryBundle.git src/Sonata/jQueryBundle
  git submodule add <EMAIL>:sonata-project/BluePrintBundle.git src/Sonata/BluePrintBundle
  git submodule add <EMAIL>:sonata-project/AdminBundle.git src/Sonata/AdminBundle
  git submodule add <EMAIL>:sonata-project/MenuBundle.git src/Knplabs/Bundle/MenuBundle

Next, be sure to enable the bundles in your application kernel:

.. code-block:: php

  // app/autoload.php
  $loader->registerNamespaces(array(
      // ...
      'Sonata'                         => __DIR__.'/../src',
      'Knplabs'                        => __DIR__.'/../src',
      // ...
  ));

  // app/AppKernel.php
  public function registerBundles()
  {
      return array(
          // ...
          new Sonata\jQueryBundle\SonatajQueryBundle(),
          new Sonata\BluePrintBundle\SonataBluePrintBundle(),
          new Sonata\AdminBundle\SonataAdminBundle(),
          new Knplabs\Bundle\MenuBundle\KnplabsMenuBundle(),
          // ...
      );
  }

Configuration
-------------

The bundle also contains several routes. Import them by adding the following
code to your application's routing file:

- Add the AdminBundle's routing definition

.. code-block:: yaml

    # app/config/routing.yml
    admin:
        resource: '@SonataAdminBundle/Resources/config/routing/sonata_admin.xml'
        prefix: /admin

    _sonata_admin:
        resource: .
        type: sonata_admin
        prefix: /admin

Now, install the assets of the different bundles: ``php app/console assets:install web``.
At this point you can access to the dashboard with the url: ``http://yoursite.local/admin/dashboard``.

.. note::

    If you're using XML or PHP to specify your application's configuration,
    the above configuration and routing will actually be placed in those
    files, with the correct format (i.e. XML or PHP).


Declaring new Entity
--------------------

Once you have created an admin class, you must declare the class to use it. Like ::

.. code-block:: xml<commit_msg>[doc] add symlink option<commit_after>Installation
============

Make sure you have ``Sonata`` and ``Knplabs`` exists, if not create them::

  mkdir src/Sonata
  mkdir src/Knplabs

To begin, add the dependent bundles to the ``src/`` directory. If using
git, you can add them as submodules::

  git submodule add <EMAIL>:sonata-project/jQueryBundle.git src/Sonata/jQueryBundle
  git submodule add <EMAIL>:sonata-project/BluePrintBundle.git src/Sonata/BluePrintBundle
  git submodule add <EMAIL>:sonata-project/AdminBundle.git src/Sonata/AdminBundle
  git submodule add <EMAIL>:sonata-project/MenuBundle.git src/Knplabs/Bundle/MenuBundle

Next, be sure to enable the bundles in your application kernel:

.. code-block:: php

  // app/autoload.php
  $loader->registerNamespaces(array(
      // ...
      'Sonata'                         => __DIR__.'/../src',
      'Knplabs'                        => __DIR__.'/../src',
      // ...
  ));

  // app/AppKernel.php
  public function registerBundles()
  {
      return array(
          // ...
          new Sonata\jQueryBundle\SonatajQueryBundle(),
          new Sonata\BluePrintBundle\SonataBluePrintBundle(),
          new Sonata\AdminBundle\SonataAdminBundle(),
          new Knplabs\Bundle\MenuBundle\KnplabsMenuBundle(),
          // ...
      );
  }

Configuration
-------------

The bundle also contains several routes. Import them by adding the following
code to your application's routing file:

- Add the AdminBundle's routing definition

.. code-block:: yaml

    # app/config/routing.yml
    admin:
        resource: '@SonataAdminBundle/Resources/config/routing/sonata_admin.xml'
        prefix: /admin

    _sonata_admin:
        resource: .
        type: sonata_admin
        prefix: /admin

Now, install the assets of the different bundles: ``php app/console assets:install web --symlink``.
At this point you can access to the dashboard with the url: ``http://yoursite.local/admin/dashboard``.

.. note::

    If you're using XML or PHP to specify your application's configuration,
    the above configuration and routing will actually be placed in those
    files, with the correct format (i.e. XML or PHP).


Declaring new Entity
--------------------

Once you have created an admin class, you must declare the class to use it. Like ::

.. code-block:: xml
{'fraction_non_alphanumeric': 0.1196618252763928, 'fraction_numerical': 0.0, 'mean_word_length': 2.6590007930214115, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '5382196', 'n_tokens_mistral': 1362, 'n_tokens_neox': 1285, 'n_words': 413}