PHPackages                             phpink/nami-core-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. phpink/nami-core-bundle

ActiveSymfony-bundle

phpink/nami-core-bundle
=======================

Nami CMS - CORE Bundle

111PHP

Since Apr 15Pushed 9y agoCompare

[ Source](https://github.com/phpink/nami-core-bundle)[ Packagist](https://packagist.org/packages/phpink/nami-core-bundle)[ RSS](/packages/phpink-nami-core-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

Nami CMS : CoreBundle
=====================

[](#nami-cms--corebundle)

Welcome to the NamiCoreBundle repository - a Symfony 2.7 bundle.

[![Nami Logo](https://github.com/phpink/nami-core-bundle/raw/master/Docs/namiLogo.png)](https://github.com/phpink/nami-core-bundle/raw/master/Docs/namiLogo.png)

**PhpInk\\Nami\\CoreBundle** is the main bundle of a Nami CMS application. It contains the dependencies configuration, *Doctrine ORM/ODM* mapping and *FOSRest* controllers to provide an API.

1. Installation

---

### Getting started

[](#getting-started)

Run the following command to install the bundle :

```
composer require phpink/nami-core-bundle

```

To get NAMI working with MongoDB, after specifying the configuration driver to ''odm''' instead of '''orm''', add the following line to your composer.json :

```
        "doctrine/mongodb-odm-bundle": "3.0.*@dev",

```

Then, add the following line to your AppKernel.php :

```
        new Doctrine\Bundle\MongoDBBundle\DoctrineMongoDBBundle(),

```

### Generate new RSA keys \[optional\]

[](#generate-new-rsa-keys-optional)

Run the following OpenSSL commands to generate RSA keys for JSON Web Token authentication :

```
openssl genrsa -out app/var/jwt/private.pem -aes256 4096
openssl rsa -pubout -in app/var/jwt/private.pem -out app/var/jwt/public.pem

```

2. API endpoints

---

All available endpoints are available in a [Postman](https://www.getpostman.com/) dump

```
nami.postman_collection

```

Some http client you can run to test the API :

```
GET     http://host/api-doc/     REST API documentation [HTML]
GET     http://host/api/         REST API ping [JSON]
POST    http://host/api/token    API token getter [JSON]
GET     http://host/api/pages    API get all method [JSON]
GET     http://host/api/pages/1  API get one method [JSON]
POST    http://host/api/pages/1  API update one method [JSON]
DELETE  http://host/api/pages/1  API delete one method [JSON]

```

What's inside?
--------------

[](#whats-inside)

The bundle is configured with the following defaults:

- Twig is the only configured template engine;
- Translations are activated
- Doctrine ORM/DBAL or Doctrine MongoDB is configured;
- Swiftmailer is configured;
- Annotations for everything are enabled.

It comes pre-configured with the following bundles:

- **FrameworkBundle** - The core Symfony framework bundle
- [**SensioFrameworkExtraBundle**](http://symfony.com/doc/2.6/bundles/SensioFrameworkExtraBundle/index.html) - Adds several enhancements, including template and routing annotation capability
- [**DoctrineBundle**](http://symfony.com/doc/2.6/book/doctrine.html) - Adds support for the Doctrine ORM
- [**DoctrineMongoDBBundle**](https://github.com/doctrine/DoctrineMongoDBBundle) - Adds support for the Doctrine ODM
- [**DoctrineExtensions**](https://github.com/Atlantic18/DoctrineExtensions) - Doctrine2 behavioral extensions
- [**DoctrineFixtures**](https://github.com/doctrine/DoctrineFixturesBundle) (in dev/test env) - Load data fixtures into the Doctrine ORM
- [**TwigBundle**](http://symfony.com/doc/2.6/book/templating.html) - Adds support for the Twig templating engine
- [**SecurityBundle**](http://symfony.com/doc/2.6/book/security.html) - Adds security by integrating Symfony's security component
- [**SwiftmailerBundle**](http://symfony.com/doc/2.6/cookbook/email.html) - Adds support for Swiftmailer, a library for sending emails
- [**MonologBundle**](http://symfony.com/doc/2.6/cookbook/logging/monolog.html) - Adds support for Monolog, a logging library
- [**AsseticBundle**](http://symfony.com/doc/2.6/cookbook/assetic/asset_management.html) - Adds support for Assetic, an asset processing library
- **WebProfilerBundle** (in dev/test env) - Adds profiling functionality and the web debug toolbar
- **SensioDistributionBundle** (in dev/test env) - Adds functionality for configuring and working with Symfony distributions
- [**SensioGeneratorBundle**](http://symfony.com/doc/2.6/bundles/SensioGeneratorBundle/index.html) (in dev/test env) - Adds code generation capabilities
- [**FOSRestBundle**](https://github.com/FriendsOfSymfony/FOSRestBundle) - Adds rest functionality
- [**FOSHttpCacheBundle**](https://github.com/lexik/LexikJWTAuthenticationBundle) - This bundle offers tools to improve HTTP caching with Symfony2
- [**NelmioApiDocBundle**](https://github.com/nelmio/NelmioApiDocBundle) - Add API documentation features
- [**BazingaHateoasBundle**](https://github.com/willdurand/BazingaHateoasBundle) - Adds HATEOAS support
- [**HautelookTemplatedUriBundle**](https://github.com/hautelook/TemplatedUriBundle) - Adds Templated URIs (RFC 6570) support
- [**BazingaRestExtraBundle**](https://github.com/willdurand/BazingaRestExtraBundle)
- [**LexikJWTAuthenticationBundle**](https://github.com/lexik/LexikJWTAuthenticationBundle) - JSON Web Token generation
- [**GfreeauGetJWTBundle**](https://github.com/gfreeau/GfreeauGetJWTBundle) - JSON Web Token authentication
- [**LiipImagineBundle**](https://github.com/liip/LiipImagineBundle) - Image thumbnail generation

Enjoy!

API inner working
-----------------

[](#api-inner-working)

### Controllers

[](#controllers)

CoreBundle controllers extend a base `AbstractController`, which contains a set of methods for the Doctrine CRUD worflow. Associated Doctrine model/repository &amp; FormType class names are guessed automatically.

For example: `NamiCoreBundle:Model\Orm\User` entity &amp; `NamiCoreBundle:Form\UserType` for `NamiCoreBundle:Controller\UserController`.

The doctrine repository used by the controller to run the generic CRUD commands is the one associated by default to the model. A different one can be called :

```
public function getEntitiesAction() {
    $productRepo = $this->getRepository('Product'); // From model name
    // or
    $productRepo = $this->getRepository('\PhpInk\Nami\CoreBundle\Model\Orm\Products'); // More specific
    ...
    return $this->restView(...); // Returns a JSON response
}
```

### Repositories

[](#repositories)

Core repositories extend a base `AbstractRepository`, which contains all the CRUD methods called from controllers. Repositories can overload the base properties, such as `orderByFields`, `filterByFields`.

They must implement a `buildItemsQuery` method that will be called to create the Doctrine QueryBuilder retrieving one or more item from the database.

As for creation &amp; update, the controllers instantiate the form type related to the associated model.

### Json TO Forms

[](#json-to-forms)

A JsonDecoder is implemented and modifies the input request data. It is called from the FosRest body listener (configuration is in `src/PhpInk/CoreBundle/DependencyInjection/NamiCoreBundleExtension.php`).

It transforms json input booleans `true,false` into optional `0,1` checkboxes for FormTypes.

To execute specific code after an item creation or update, take a look at the `UserController::onPostSave` method that sends the user confirmation mail.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 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.

### Community

Maintainers

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

---

Top Contributors

[![geofrwa](https://avatars.githubusercontent.com/u/17264398?v=4)](https://github.com/geofrwa "geofrwa (54 commits)")

### Embed Badge

![Health badge](/badges/phpink-nami-core-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/phpink-nami-core-bundle/health.svg)](https://phpackages.com/packages/phpink-nami-core-bundle)
```

PHPackages © 2026

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