Download the PHP package kunicmarko/configuration-panel without Composer
On this page you can find all versions of the php package kunicmarko/configuration-panel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kunicmarko/configuration-panel
More information about kunicmarko/configuration-panel
Files in kunicmarko/configuration-panel
Package configuration-panel
Short Description This is a Symfony Bundle that adds configuration panel to your sonata admin.
License MIT
Homepage https://github.com/kunicmarko20/configuration-panel
Informations about the package configuration-panel
Sonata Configuration Panel
This bundle adds configuration panel to your sonata admin, also you can easily extend bundle and add your own types.
This bundle depends on SonataAdminBundle
Documentation
- Installation
- How to use
- Add new type
- Roles and Categories
- Additional stuff
Installation
1. Add to composer.json to the require
key
2. Register the bundle in app/AppKernel.php
If you are not using auto_mapping add it to your orm mappings
3. Update database
4. Clear cache
How to use
In your twig template you can call it like :
if you want to use it in controller you can do :
Add new type
If you want to add new types, you can do it like this
Creating new Type
Your new type has to extend AbstractConfiguration, you also have to specify template used for sonata list (it can be sonata template, or your own created), and how should field be rendered in form.
1. New type without new column
2. New type with new column
As you can see from example code below, we added new $date
field, the one thing that is necessary is to overwrite getValue()
method with delegating to your getter for new field as shown below.
Do not forget to update database after adding new field :
Roles and Categories
This bundle was made as help to developers so only ROLE_SUPER_ADMIN
can create and delete items, regular admins can only edit. ( You can create keys and allow other admins to just edit them ).
There are 2 categories when creating item, Meta
and General
, only ROLE_SUPER_ADMIN
can see and edit items that are in META
category while normal admins can only edit and see General
items.
Additional stuff
When including this bundle you get access to some twig filters I needed.
Elapsed
In twig you can use |elapsed
filter and you will get human readable time, it works with timestamps or DateTime objects.