---
title: "Installation & Setup"
package: "PagerfantaBundle"
version: "2.x"
canonical_url: "https://www.babdev.com/open-source/packages/pagerfantabundle/docs/2.x/installation"
package_supported: true
version_released: true
end_of_support: "2021-12-31T23:59:59.999Z"
notice:
  - "Version 2.x of PagerfantaBundle reached end of support on 2021-12-31."
---
# Installation & Setup

To install this bundle, run the following [Composer](https://getcomposer.org/) command:

```bash
composer require babdev/pagerfanta-bundle
```

## Register The Bundle

### Symfony Flex

For an application using Symfony Flex the bundle should be automatically registered, but if not you will need to add it to your `config/bundles.php` file.

```php
<?php

return [
    // ...

    BabDev\PagerfantaBundle\BabDevPagerfantaBundle::class => ['all' => true],
];
```

### Symfony Standard

For an application based on the Symfony Standard structure, you will need to add the bundle to your `AppKernel` class' `registerBundles()` method.

```php
<?php
// app/AppKernel.php

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            // ...

            new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(),
        ];

        // ...
    }

    // ...
}
```
