PHPackages                             ns/admin-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Admin Panels](/categories/admin)
4. /
5. ns/admin-bundle

ActiveLibrary[Admin Panels](/categories/admin)

ns/admin-bundle
===============

Simple framework for generating SF4/5 admin pages.

1.1.5(5y ago)01651proprietaryPHP

Since Jun 24Pushed 5y ago2 watchersCompare

[ Source](https://github.com/NobletSolutions/AdminBundle)[ Packagist](https://packagist.org/packages/ns/admin-bundle)[ Docs](https://github.com/NobletSolutions/AdminBundle)[ RSS](/packages/ns-admin-bundle/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (4)Versions (14)Used By (1)

AdminBundle
===========

[](#adminbundle)

Simple framework for generating SF4/5 admin. Allows you to create simple admin pages for managing entities by creating a basic entity, service, repository, and controller class for each entity.

Requires more coding than using an admin generator like Sonata, but allows for much greater flexibility by ditching complex configurators for simple, easily-overridden and extended classes.

\##Installation

Require the AdminBundle

`composer require ns/admin-bundle`

add it to your project bundles.php

`NS\AdminBundle\NSAdminBundle::class => ['all' => true],`

and require the routing config in your project routes.yaml file

```
ns_admin:
    resource: "@NSAdminBundle/Resources/config/routing.yml"
    prefix:  /admin
```

Create your entity, and extend `AdminSoftDeletableEntity`. Remember to define a `__toString()` method:

```
class FooBar extends NS\AdminBundle\Entity\AdminSoftDeletableEntity
{
    public function __toString()
    {
        return 'somestring';
    }
}
```

You can extend `BaseAdminEntity` instead, if you don't need soft delete functionality.

Create the entity repository, extend `AbstractAdminManagedRepository`, and define the constructor:

```
class FooBarRepository extends NS\AdminBundle\Repository\AbstractAdminManagedRepository
{
    public function __construct(Doctrine\Persistence\ManagerRegistry $registry)
    {
        parent::__construct($registry, FooBar::class);
    }
}
```

Create the entity service, extend `AdminService`, and define the getClass() method:

```
class FooBarService extends NS\AdminBundle\Service\AdminService
{
    public function getClass(): string
    {
        return FooBar::class;
    }
}
```

Create the edit form for your entity:

```
class FooBarEditType extends Symfony\Component\Form\AbstractType
{
    public function buildForm()
    {
        //...
    }
}
```

Create the admin list template for your entity, extending `'@NSAdmin/list.html.twig'`. Define the following blocks:

- `model_create_icon`
- `list_column_headers`
- `list_row blocks`

If using a 'view' page instead of proceeding straight from the list to the edit form, override `view_button`, uncomment the button code, and modify as needed, then create the view template and extend `'@NSAdmin/view.html.twig'`

Create the admin controller for your entity, extending `AbstractAdminController` and define the following methods:

```
class FoobarAdminController extends NS\AdminBundle\Controller\AbstractAdminController
{
    public function __construct(FooBarService $admin_service)
    {
        parent::__construct($admin_service);
    }

    protected function getEditFormClass(): string
    {
        return FooBarEditType::class;
    }

    protected function getListTemplate(): string
    {
        return 'path/to/list.html.twig';
    }

    //Only needed if using a view template:
    protected function getViewTemplate(): string
    {
        return 'path/to/view.html.twig';
    }

}
```

The built-in routing will automatically route requests to a controller matching the format **%Entityclass%AdminController**, where **%Entityclass%** is an initial-caps variant of your entity class name.

`{{ path('admin_model_index', {'_admin_model'=>'foobar'}) }}`

For our example of FooBar, and admin controller class of `FoobarAdminController` will be automatically routed to; `FooBarAdminController` will require manual routing.

To add an entry to the MenuBuilder in ColorAdminBundle, use the parameters `['route' => 'admin_model_index', 'routeParameters' => ['_admin_model' => 'foobar']]`

###  Health Score

28

—

LowBetter than 51% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~12 days

Recently: every ~6 days

Total

13

Last Release

2093d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fac4100d94ea33234f843fa897f647c4bc8f9b1b43d7e93ed59f7cf49415f487?d=identicon)[mwoynarski](/maintainers/mwoynarski)

---

Top Contributors

[![mwoynarski](https://avatars.githubusercontent.com/u/143827?v=4)](https://github.com/mwoynarski "mwoynarski (27 commits)")

### Embed Badge

![Health badge](/badges/ns-admin-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/ns-admin-bundle/health.svg)](https://phpackages.com/packages/ns-admin-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k6.0M778](/packages/sylius-sylius)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.9M535](/packages/pimcore-pimcore)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M236](/packages/sulu-sulu)[kunstmaan/bundles-cms

The Kunstmaan CMS is an advanced yet user-friendly content management system, based on the full stack Symfony framework combined with a whole host of community bundles. It provides a full featured, multi-language CMS system with an innovative page and form assembling process, versioning, workflow, translation and media managers and much more.

414291.2k19](/packages/kunstmaan-bundles-cms)[sylius/order-bundle

Sales order management for Symfony applications.

11447.8k12](/packages/sylius-order-bundle)[sulu/skeleton

Project template for starting your new project based on the Sulu content management system

29736.0k](/packages/sulu-skeleton)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
