modera / backend-tools-settings-bundle
Installs: 4 080
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 6
Forks: 0
Open Issues: 0
Language:JavaScript
Type:symfony-bundle
Requires
- php: >=5.6
- modera/foundation-bundle: ~3.1|~4.0
Requires (Dev)
- phpunit/phpunit: ^5.5
- dev-master / 4.x-dev
- 3.x-dev
- v3.1.0
- v3.0.0
- 2.x-dev
- v2.57.0
- v2.56.0
- v2.55.0
- v2.54.0
- v2.53.0
- v2.52.2
- v2.52.1
- v2.52.0
- v2.51.1
- v2.51.0
- v2.0.50
- dev-sf3
- dev-crub_pagination_fetch_fix
- dev-direct-bundle-csrf
- dev-MPFE-1005
- dev-MPFE-1007
- dev-MPFE-1014
- dev-MPFE-1014-2
- dev-MPFE-1017
- dev-MPFE-1029
- dev-MPFE-963
- dev-MPFE-975
- dev-MPFE-977
This package is auto-updated.
Last update: 2024-10-29 04:14:40 UTC
README
Provides a unified way of exposing sections that would allow to configure your modules. This bundle contributes a section to "Backend / Tools" called "Settings".
See Modera\BackendToolsSettingsBundle\ModeraBackendToolsSettingsBundle
for a list of exposed extension points.
Installation
Step 1: Download the Bundle
composer require modera/backend-tools-settings-bundle:4.x-dev
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Step 2: Enable the Bundle
This bundle should be automatically enabled by Flex.
In case you don't use Flex, you'll need to manually enable the bundle by
adding the following line in the config/bundles.php
file of your project:
<?php // config/bundles.php return [ // ... Modera\BackendToolsSettingsBundle\ModeraBackendToolsSettingsBundle::class => ['all' => true], ];
How to contribute your own settings section
In order to just contribute a section ( an activity ) to Settings section you need to create a provider class
which would return instances of Modera\BackendToolsSettingsBundle\Section\SectionInterface
. This is an example
how to contributor class could look like:
<?php namespace MyCompany\BlogBundle\Contributions; use Modera\BackendToolsSettingsBundle\Section\StandardSection; use Modera\MjrIntegrationBundle\Model\FontAwesome; use Sli\ExpanderBundle\Ext\ContributorInterface; class SettingsSectionsProvider implements ContributorInterface { /** * @inheritDoc */ public function getItems() { return array( new StandardSection( 'blog', 'Blog', 'Modera.backend.configutils.runtime.SettingsListActivity', FontAwesome::resolve('cog', 'fas'), array('category' => 'blog') ) ); } }
Once you have created a class you need to register it in service container with tag modera_backend_tools_settings.contributions.sections_provider
.
<services> <service id="mycompany_blog.contributions.settings_sections_provider" class="MyCompany\BlogBundle\Contributions\SettingsSectionsProvider"> <tag name="modera_backend_tools_settings.contributions.sections_provider" /> </service> </services>
Now if you go to "Backend / Tools / Settings" you should see a section there with name "Blog", it url it will be
named as "blog", icon will be "gear" ( see FontAwesome library ) and Modera.backend.dcab.runtime.SettingsListActivity
javascript activity will be used to create its UI.
Licensing
This bundle is under the MIT license. See the complete license in the bundle: Resources/meta/LICENSE