Installation
composer require bigfoot/core-bundle
Register the bundle in app/AppKernel.php:
$bundles = [
// ...
new Bigfoot\Bundle\CoreBundle\BigfootCoreBundle(),
];
Database Setup
Run migrations to create widget_backoffice and widget_backoffice_parameter tables (if not auto-generated):
php bin/console doctrine:migrations:diff
php bin/console doctrine:migrations:migrate
First Use Case
Access /admin to verify the base admin interface is loaded. No widgets will appear yet—this is expected.
Extend AbstractWidget
namespace AppBundle\Widget;
use Bigfoot\Bundle\CoreBundle\Model\AbstractWidget;
class MyCustomWidget extends AbstractWidget
{
public function renderContent()
{
return '<div>Hello, Bigfoot!</div>';
}
}
Register Widget in Database
widget_backoffice:
INSERT INTO widget_backoffice (name, title) VALUES ('AppBundle\\Widget\\MyCustomWidget', 'My Custom Widget');
INSERT INTO widget_backoffice_parameter (name, value, widget_id) VALUES ('order', '1', LAST_INSERT_ID());
INSERT INTO widget_backoffice_parameter (name, value, widget_id) VALUES ('width', '3', LAST_INSERT_ID());
Dynamic Widget Loading
Override BigfootCoreBundle's widget loader (if needed) in a custom service:
# config/services.yml
services:
app.widget_loader:
class: AppBundle\Service\CustomWidgetLoader
arguments: ['@bigfoot.core.widget_loader']
Translatable Titles
Use Symfony’s translation system for title field:
# config/packages/translation.yaml
locales: ['en', 'fr']
Database Dependency
widget_backoffice before appearing. No autoloading exists for classes.Outdated Symfony Support
symfony/framework-bundle).No Built-in Routing
/admin is hardcoded. Customize via a route override:
# config/routes.yaml
admin:
resource: "@BigfootCoreBundle/Resources/config/routing.yml"
prefix: /custom-admin-path
Widget Not Showing?
widget_backoffice matches exactly (namespace included).widget_backoffice_parameter for order and width values.Translations Missing
Resources/translations/ with the correct domain (messages).Performance
renderContent():
public function renderContent()
{
return $this->cache->get('widget_my_custom_key', function() {
return '<div>Cached content</div>';
});
}
Custom Widget Storage Override the widget repository to use a different data source (e.g., API):
// src/Service/CustomWidgetRepository.php
class CustomWidgetRepository extends \Bigfoot\Bundle\CoreBundle\Repository\WidgetRepository
{
public function findAll() { /* Custom logic */ }
}
Event Listeners
Hook into widget lifecycle via Symfony events (e.g., bigfoot.widget.pre_render):
// src/EventListener/WidgetListener.php
class WidgetListener
{
public function onPreRender(WidgetEvent $event)
{
$event->setContent('<div>Modified: ' . $event->getContent() . '</div>');
}
}
Legacy Compatibility
If using with older Symfony (2.x/3.x), pin dependencies in composer.json:
"extra": {
"symfony": {
"require": "3.4.*"
}
}
How can I help you explore Laravel packages today?