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

Admingenerator Oldtheme Bundle Laravel Package

cedriclombardot/admingenerator-oldtheme-bundle

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation Add the bundle to your composer.json:

    composer require cedriclombardot/admingenerator-oldtheme-bundle
    

    Register the bundle in config/bundles.php (Symfony 4+):

    return [
        // ...
        CedricLombardot\AdminGeneratorOldThemeBundle\CedricLombardotAdminGeneratorOldThemeBundle::class => ['all' => true],
    ];
    
  2. Configuration Ensure admingenerator is configured in config/packages/admingenerator.yaml:

    admingenerator:
        theme: old  # Explicitly set to use the old theme
    
  3. First Use Case Generate a CRUD for an existing entity (e.g., User):

    php bin/console admingenerator:generate --dest=src --theme=old --model=App\Entity\User
    

    Navigate to /admin to see the legacy-style admin interface.


Implementation Patterns

Workflow Integration

  1. Legacy Admin Migration

    • Use this bundle to preserve existing admin interfaces while migrating to newer Symfony versions.
    • Example: Generate a UserAdmin class with the old theme, then incrementally update templates/views.
  2. Hybrid Theming

    • Mix old and new themes by conditionally setting the theme per route:
      # config/routes.yaml
      admin_old:
          resource: "@AdminGeneratorOldThemeBundle/Resources/config/routing.yml"
          prefix: /admin/legacy
      
  3. Customization

    • Override old theme templates in templates/admin/ (e.g., base.html.twig).
    • Extend the AdminGeneratorOldThemeBundle by creating a custom theme bundle inheriting from it.
  4. Entity-Specific Themes

    • Use the --theme=old flag per generation:
      php bin/console admingenerator:generate --model=App\Entity/Product --theme=old
      

Common Patterns

  • Form Customization: Extend AdminGeneratorOldThemeBundle:Form:fields.html.twig for consistent styling.
  • Asset Management: Override CSS/JS in public/bundles/admingeneratoroldtheme/ to align with your app’s design.
  • Permissions: Use Symfony’s security system (e.g., @IsGranted("ROLE_ADMIN")) alongside the old theme’s access controls.

Gotchas and Tips

Pitfalls

  1. Deprecation Warnings

    • The bundle is not actively maintained (Symfony 2-era codebase). Expect compatibility issues with modern Symfony (5.4+).
    • Workaround: Use a Dockerized Symfony 4.4 environment for testing.
  2. Template Overrides

    • Incorrect template paths may break rendering. Verify overrides are in:
      templates/admin/AdmingeneratorOldThemeBundle/
      
    • Debug Tip: Clear cache after template changes:
      php bin/console cache:clear
      
  3. Routing Conflicts

    • The bundle registers routes under /admin. Conflict with other bundles (e.g., EasyAdmin) by:
      • Using a custom prefix (see Hybrid Theming above).
      • Disabling the bundle’s routes via config:
        admingenerator:
            generate_routes: false
        
  4. Entity Generation Quirks

    • Associations: Nested forms may render poorly. Use --no-form flag for complex relations:
      php bin/console admingenerator:generate --model=App\Entity/Order --no-form
      

Debugging Tips

  • Enable Debug Mode: Add to config/packages/dev/debug.yaml:
    framework:
        templating:
            engines: ['twig']
    
  • Check Logs: Run with verbose output:
    php bin/console admingenerator:generate -v
    
  • Symfony Profiler: Use the web debug toolbar to inspect template rendering.

Extension Points

  1. Custom Fields

    • Add field types by extending AdminGeneratorOldThemeBundle:Form:fields.html.twig or creating a custom field type class.
  2. Action Overrides

    • Override actions (e.g., edit, delete) in src/Admin/YourAdmin.php:
      protected function configureActions() {
          $this->actions['delete'] = ['icon' => 'trash'];
      }
      
  3. Event Listeners

    • Subscribe to admingenerator.generate events to modify generation dynamically:
      // src/EventListener/AdminGeneratorListener.php
      public function onGenerate(GenerateEvent $event) {
          $event->setTheme('old');
      }
      
      Register in services.yaml:
      services:
          App\EventListener\AdminGeneratorListener:
              tags:
                  - { name: kernel.event_listener, event: admingenerator.generate }
      
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.
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver