Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Bicorebundle Laravel Package

comunedifirenze/bicorebundle

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation

    composer require comunedifirenze/bicorebundle
    

    Add to config/bundles.php:

    return [
        // ...
        ComuneFI\BiCoreBundle\BiCoreBundle::class => ['all' => true],
    ];
    
  2. Basic Configuration Ensure bootstrap-italia is installed (via npm or CDN) and configure in config/packages/bicore.yaml:

    bicore:
        bootstrap_italia:
            enabled: true
            theme: 'default' # or 'custom'
    
  3. First Use Case: Quick Table Interface Use the built-in table generator for Doctrine entities:

    // src/Controller/SomeController.php
    use ComuneFI\BiCoreBundle\Controller\TableController;
    
    class SomeController extends TableController
    {
        protected $entityClass = 'App\Entity\YourEntity';
    }
    

    Define a route in config/routes.yaml:

    bicore_table:
        resource: "@BiCoreBundle/Resources/config/routing/table.yaml"
        prefix: /admin
    

Implementation Patterns

Common Workflows

  1. CRUD Operations Extend ComuneFI\BiCoreBundle\Controller\CrudController for full CRUD:

    class UserController extends CrudController
    {
        protected $entityClass = 'App\Entity\User';
        protected $formType = 'App\Form\UserType'; // Optional: Customize form
    }
    
  2. Bootstrap Italia Components Use pre-built components (e.g., modals, alerts) via Twig:

    {% bicore_modal('example-modal', 'Modal Title') %}
        <p>Modal content here.</p>
    {% endbicore_modal %}
    
  3. Database Schema to Entities Convert MySQL Workbench schemas to Doctrine entities:

    php bin/console bicore:schema-to-entities --schema=path/to/schema.sql
    
  4. Custom Templates Override default templates in templates/bicore/ (e.g., table.html.twig).

Integration Tips

  • Doctrine Fixtures: Use bicore:fixtures:load for test data:
    php bin/console bicore:fixtures:load
    
  • Asset Management: Bootstrap Italia assets are auto-registered if enabled: true in config.
  • Translation: Extend bicore/translations/ for custom translations.

Gotchas and Tips

Pitfalls

  1. Bootstrap Italia Dependency

    • Ensure bootstrap-italia is installed (via npm or CDN). The bundle does not auto-install it.
    • Debug missing styles/scripts by checking browser console for 404s on /build/ assets.
  2. Route Conflicts

    • Default routes (e.g., /admin/*) may clash with existing routes. Prefix or rename in routing.yaml.
  3. Doctrine Schema Conversion

    • The schema-to-entities command assumes a MySQL-compatible schema. Adjust for PostgreSQL/SQLite quirks (e.g., SERIAL vs AUTO_INCREMENT).
  4. Twig Extensions

    • Twig functions like bicore_modal must be loaded. Verify BiCoreBundle is registered in bundles.php.

Debugging

  • Enable Debug Mode: Set debug: true in config/packages/bicore.yaml for verbose logs.
  • Check Events: Listen for bicore.event in Symfony’s event dispatcher for custom logic:
    // config/services.yaml
    ComuneFI\BiCoreBundle\EventListener\YourListener:
        tags:
            - { name: kernel.event_listener, event: bicore.event, method: onEvent }
    

Extension Points

  1. Custom Form Types Override default forms by extending ComuneFI\BiCoreBundle\Form\Type\BaseType:

    class CustomUserType extends BaseType
    {
        public function buildForm(FormBuilderInterface $builder, array $options)
        {
            $builder->add('custom_field', TextType::class);
        }
    }
    
  2. Dynamic Table Columns Modify table columns via Twig:

    {% bicore_table_row entity %}
        <td>{{ entity.customField }}</td> {# Override default column #}
    {% endbicore_table_row %}
    
  3. Authentication Extend the login system by overriding BiCoreBundle:Security:login.html.twig and configuring guard in security.yaml:

    firewalls:
        main:
            form_login:
                template: BiCoreBundle:Security:login.html.twig
    
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
comsave/common
alecsammon/php-raml-parser
chrome-php/wrench
lendable/composer-license-checker
typhoon/reflection
mesilov/moneyphp-percentage
mike42/gfx-php
bookdown/themes
aura/view
aura/html
aura/cli
povils/phpmnd
nayjest/manipulator
omnipay/tests
psr-mock/http-message-implementation
psr-mock/http-factory-implementation
psr-mock/http-client-implementation
voku/email-check
voku/urlify
rtheunissen/guzzle-log-middleware