<commit_before>RollerworksNavigationBundle
===========================

The RollerworksNavigationBundle adds the ability to define menu-structures
and breadcrumbs for the KnpMenuBundle in the app-config.

## Installation

> Please make sure you install the KnpMenuMenuBundle before continuing.

### Step 1: Using Composer (recommended)

To install the RollerworksNavigationBundle with Composer just add the following to your
`composer.json` file:

```js
// composer.json
{
    // ...
    require: {
        // ...
        "rollerworks/navigation-bundle": "1.*"
    }
}
```

Then, you can install the new dependencies by running Composer's ``update``
command from the directory where your ``composer.json`` file is located:

```bash
$ php composer.phar update rollerworks/navigation-bundle
```

Now, Composer will automatically download all required files, and install them
for you. All that is left to do is to update your ``AppKernel.php`` file, and
register the new bundle:

```php
<?php

// in AppKernel::registerBundles()
$bundles = array(
    // ...
    new Rollerworks\Bundle\NavigationBundle\RollerworksNavigationBundle(),
    // ...
);
```

## Documentation

> Currently only YAML and the PHP format are supported.
> XML support is planned for later.

### Expressions

The "parameters" config supports the Symfony ExpressionLanguage.

Values starting with an '@'-sign will be treated as expressions, to escape the value use a double '@'-sign
like '@@your value', the leading '@@' is then converted to '@'.

> **Note:** Expressions require at least version 2.4 of the DependencyInjection component.

### Defining menus

Menus can be declared under the `rollerworks_navigation.menus`,
you can add as menu menus as you like.

Each menu is registered in the Service Container as `rollerworks_navigation.menu.[menu-name]`
and is tagged for the KnpMenu loader by the menu-name.

```yaml
rollerworks_navigation:
    menus:
        menu-name:
            template: ~ # optional template, used by the Menu builder
            items:
                -
                    label:             ~                            # Label of the breadcrumb will be translated with the translator_domain
                    translator_domain: Menus                        # translator domain for the label
                    route:             { name: ~, parameters: { } } # name can not be empty
                    items:             []                           # Sub-level items, same as this example (unlimited depth nesting)

                    # alternatively you can reference a service for getting the Menu object
                    # The service must return a Knp\Menu\ItemInterface instance
                    service:
                        id:         ~  # service-id, can not be empty
                        method:     ~  # method to call on the service, can not be empty
                        parameters: [] # Parameter to pass to the method (same as service container parameters, including Expression)
```

*Note:** You can only either use the static, service or expression.
When using either service or expression any sub-items must provided by the returned object.

### Defining breadcrumbs

Breadcrumbs can be declared under the `rollerworks_navigation.breadcrumbs`,
you can add as menu breadcrumbs as you like.

In comparison with menus, deeper breadcrumbs reference there parent by name,
the parent may in turn reference another parent.

> **WARNING Recursion is currently not detected!!**

Its a good practice to keep the related breadcrumb(s) in the bundle itself,
and use a 'root-bundle' to reference from.

Use the importing capabilities of the Symfony Config component for
importing config files from the bundles.

The final structure is normalized before registering so no
complex building at runtime is done.

Each breadcrumb is registered in the Service Container as `rollerworks_navigation.breadcrumbs.[breadcrumb-name]`
and is tagged for the KnpMenu loader by the menu-name.

```yaml
rollerworks_navigation:
    breadcrumbs:
        breadcrumb-name:
            parent:            ~                            # Optional parent breadcrumb to reference (by name)
            label:             ~                            # Label of the breadcrumb will be translated with the translator_domain
            translator_domain: Breadcrumbs                  # translator domain for the label
            route:             { name: ~, parameters: { } } # name can not be empty

            # alternatively you can reference a service for getting the Menu object
            # The service must return a Knp\Menu\ItemInterface instance
            service:
                id:         ~  # service-id, can not be empty
                method:     ~  # method to call on the service, can not be empty
                parameters: [] # Parameter to pass to the method (same as service container parameters, including Expression)
```

## License

This bundle is released under the MIT license.
See the bundled LICENSE file for details.<commit_msg>updates README.md<commit_after>RollerworksNavigationBundle
===========================

The RollerworksNavigationBundle adds the ability to define menu-structures
and breadcrumbs for the KnpMenuBundle in the app-config.

## Installation

> Please make sure you install the KnpMenuMenuBundle before continuing.

### Step 1: Using Composer (recommended)

To install the RollerworksNavigationBundle with Composer just add the following to your
`composer.json` file:

```js
// composer.json
{
    // ...
    require: {
        // ...
        "rollerworks/navigation-bundle": "1.*"
    }
}
```

Then, you can install the new dependencies by running Composer's ``update``
command from the directory where your ``composer.json`` file is located:

```bash
$ php composer.phar update rollerworks/navigation-bundle
```

Now, Composer will automatically download all required files, and install them
for you. All that is left to do is to update your ``AppKernel.php`` file, and
register the new bundle:

```php
<?php

// in AppKernel::registerBundles()
$bundles = array(
    // ...
    new Rollerworks\Bundle\NavigationBundle\RollerworksNavigationBundle(),
    // ...
);
```

## Documentation

> Currently only YAML and the PHP format are supported.
> XML support is planned for later.

### Expressions

The "parameters" config supports the Symfony ExpressionLanguage.

Values starting with an '@'-sign will be treated as expressions, to escape the value use a double '@'-sign
like '@@your value', the leading '@@' is then converted to '@'.

> **Note:** Expressions require at least version 2.4 of the DependencyInjection component.

### Defining menus

Menus can be declared under the `rollerworks_navigation.menus` configuration tree,
you can define as many menus as you need.

Each menu is registered in the Service Container as `rollerworks_navigation.menu.[menu-name]`
and is tagged for the KnpMenu loader by the menu-name.

```yaml
rollerworks_navigation:
    menus:
        menu-name:
            template: ~ # optional template, used by the Menu builder
            items:
                -
                    label:             ~                            # Label of the breadcrumb will be translated with the translator_domain
                    translator_domain: Menus                        # translator domain for the label
                    route:             { name: ~, parameters: { } } # name can not be empty
                    items:             []                           # Sub-level items, same as this example (unlimited depth nesting)

                    # alternatively you can reference a service for getting the Menu object
                    # The service must return a Knp\Menu\ItemInterface instance
                    service:
                        id:         ~  # service-id, can not be empty
                        method:     ~  # method to call on the service, can not be empty
                        parameters: [] # Parameter to pass to the method (same as service container parameters, including Expression)
```

**Note:** You can only either use the static, service or expression.

When using a service or expression sub-items must provided by the returned MenuItem object.

### Defining breadcrumbs

Breadcrumbs can be declared under the `rollerworks_navigation.breadcrumbs` configuration tree,
you define as many breadcrumbs as you need.

In comparison with menus, deeper breadcrumbs reference there parent by name,
the parent may in turn reference another parent.

> **WARNING Recursion is currently not detected!!**

Its a good practice to keep the related breadcrumb(s) in the bundle itself,
and use a 'root-bundle' to reference from.

Use the importing capabilities of the Symfony Config component for
importing config files from the bundles.

> The final structure is normalized before registering, so no complex building or resolving
> is done that runtime.

Each breadcrumb is registered in the Service Container as `rollerworks_navigation.breadcrumbs.[breadcrumb-name]`
and is tagged for the KnpMenu loader by the menu-name.

```yaml
rollerworks_navigation:
    breadcrumbs:
        breadcrumb-name:
            parent:            ~                            # Optional parent breadcrumb to reference (by name)

            # Static configuration
            label:             ~                            # Label of the breadcrumb will be translated with the translator_domain
            translator_domain: Breadcrumbs                  # translator domain for the label
            route:             { name: ~, parameters: { } } # name can not be empty

            # alternatively you can reference a service for getting the Menu object
            # The service must return a Knp\Menu\ItemInterface instance
            service:
                id:         ~  # service-id, can not be empty
                method:     ~  # method to call on the service, can not be empty
                parameters: [] # Parameter to pass to the method (same as service container parameters, including Expression)
```

## License

This bundle is released under the MIT license.
See the bundled LICENSE file for details.
{'fraction_non_alphanumeric': 0.07197340113436339, 'fraction_numerical': 0.0007823195775474281, 'mean_word_length': 2.501198219787744, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '274060', 'n_tokens_mistral': 2505, 'n_tokens_neox': 2399, 'n_words': 1121}