Installation:
composer require avoo/qcm-admin-bundle:dev-master
Ensure avoo/qcm-core-bundle is also installed (required dependency).
Register Bundles (AppKernel.php):
new Qcm\Bundle\CoreBundle\QcmCoreBundle(),
new Qcm\Bundle\AdminBundle\QcmAdminBundle(),
Configure Routing (config/routing.yml):
qcm_admin:
resource: "@QcmAdminBundle/Resources/config/routing.yml"
prefix: /admin
Import Configs (config.yml):
imports:
- { resource: "@QcmCoreBundle/Resources/config/core.yml" }
- { resource: "@QcmAdminBundle/Resources/config/core.yml" }
First Use Case:
/admin to see the default admin dashboard (if configured).QcmCoreBundle docs for entity setup).Admin Panel Generation:
@Qcm\Admin\Annotation\Admin to auto-generate admin interfaces.use Qcm\Admin\Annotation\Admin;
/**
* @Admin
*/
class Product {}
Product at /admin/product.Customizing Admin Views:
app/Resources/QcmAdminBundle/views/ to modify default layouts.qcm.admin.pre_render).Field Configuration:
@AdminField annotations to customize how entity properties are displayed/edited:
/**
* @AdminField(type="text", options={"label": "Product Name"})
*/
private $name;
Permissions & Security:
# config/security.yml
access_control:
- { path: ^/admin, roles: ROLE_ADMIN }
Integration with Forms:
FormBuilder. Extend forms via:
$builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
// Custom logic
});
/admin/{tenant}/products).qcm.admin.action events.Missing QcmCoreBundle:
avoo/qcm-core-bundle. Install it first or face routing/controller errors.Class 'Qcm\Bundle\CoreBundle\QcmCoreBundle' not found.Annotation Overrides:
php app/console cache:clear --env=prod
doctrine/annotations is installed and enabled in composer.json.Routing Conflicts:
/admin vs /app_dev.php/admin).JavaScript Translations:
BazingaJsTranslationBundle. If translations fail, verify:
# config.yml
bazinga_js_translation:
default_locale: "%locale%"
Enable Debug Mode:
config.yml:
qcm_admin:
debug: true # Logs admin actions to Symfony's logger
Event Listeners:
// src/QcmAdminBundle/EventListener/CustomListener.php
public static function getSubscribedEvents()
{
return [
'qcm.admin.pre_render' => 'onPreRender',
];
}
Template Overrides:
php app/console debug:config qcm_admin
template_path in the output.Custom Admin Classes:
/**
* @Admin(class="AppBundle\Admin\CustomProductAdmin")
*/
class Product {}
Action Handlers:
create, edit) via services:
services:
app.custom_admin_action:
class: AppBundle\Service\CustomAdminAction
tags:
- { name: qcm.admin.action_handler, action: "custom_action" }
Asset Management:
{# app/Resources/QcmAdminBundle/views/layout.html.twig #}
{{ parent() }}
{{ encore_entry_link_tags('admin-app') }}
How can I help you explore Laravel packages today?