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

Extbaser Bundle Laravel Package

edrush/extbaser-bundle

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Install the Bundle Add to composer.json:

    "require": {
        "edrush/extbaser-bundle": "^1.0"
    }
    

    Run:

    composer require edrush/extbaser-bundle
    
  2. Enable the Bundle Add to config/bundles.php:

    return [
        // ...
        Extbaser\Bundle\ExtbaserBundle::class => ['all' => true],
    ];
    
  3. First Export Define a Symfony entity (e.g., src/Entity/Article.php) with Doctrine annotations. Run:

    php bin/console extbaser:export my_extension_key
    

    This generates a TYPO3 Extbase extension skeleton in var/extbaser/.

  4. Next Steps Follow Extbaser’s upload guide to deploy to TYPO3.


Implementation Patterns

Workflow: Symfony-to-TYPO3 Development

  1. Define Entities Use Symfony’s Doctrine ORM entities (e.g., Article, User) with annotations like:

    /**
     * @ORM\Entity(repositoryClass="App\Repository\ArticleRepository")
     * @Extbaser\Mapping(
     *     extension="MyExtension",
     *     model="Article"
     * )
     */
    class Article {}
    
  2. Generate Extension Run the export command for each entity:

    php bin/console extbaser:export my_extension_key --entities=Article,User
    
  3. Iterate Locally

    • Modify Symfony entities → Re-run export → Test in TYPO3’s backend.
    • Use extbaser:clear to reset generated files before re-exporting.
  4. Integrate with TYPO3

    • Sync generated files to your TYPO3 instance (e.g., via rsync or Git).
    • Extend TYPO3’s Extbase classes (e.g., Domain/Model/Article.php) with custom logic.

Advanced Patterns

  • Shared Logic: Place reusable TYPO3/Extbase code in Symfony’s src/ (e.g., Domain/Service/) and reference it in generated templates.
  • Validation: Use Symfony’s validation constraints (e.g., @Assert\NotBlank) to auto-generate TYPO3’s validation rules.
  • Templates: Override generated TYPO3 Fluid templates in Resources/views/ and map them via @Extbaser\Template.

CI/CD Integration

Add to your pipeline:

# Example GitHub Actions step
- name: Export Extbase Extension
  run: php bin/console extbaser:export my_extension_key
- name: Deploy to TYPO3
  run: rsync -avz var/extbaser/ user@typo3-server:/path/to/typo3/ext/

Gotchas and Tips

Pitfalls

  1. Annotation Conflicts

    • Doctrine and Extbaser annotations may clash. Use fully qualified names:
      use Extbaser\Mapping as Extbaser;
      use Doctrine\ORM\Mapping as ORM;
      
    • Fix: Ensure @Extbaser\Mapping is placed after @ORM\Entity.
  2. Generated File Overwrites

    • Re-running extbaser:export overwrites files. Use --dry-run to preview changes:
      php bin/console extbaser:export my_extension_key --dry-run
      
    • Tip: Commit generated files to version control only after manual review.
  3. TYPO3-Specific Quirks

    • Extbase requires ext_typoscript_setup.txt and ext_localconf.php. These are generated but may need manual adjustments (e.g., plugin configuration).
    • Tip: Use extbaser:config to customize generated TYPO3 config:
      php bin/console extbaser:config my_extension_key --plugin-name="My Plugin"
      
  4. Circular Dependencies

    • If entities reference each other (e.g., ArticleAuthor), ensure all are exported in one command or TYPO3’s Extbase will fail to load.

Debugging

  • Check Logs: Run with -vvv for verbose output:
    php bin/console extbaser:export my_extension_key -vvv
    
  • Validate Entities: Use Symfony’s validator to catch issues early:
    php bin/console debug:validator App\Entity\Article
    

Extension Points

  1. Custom Templates Override the default Twig templates for export by creating templates/extbaser/ in your bundle.

  2. Post-Export Hooks Use Symfony’s event system to run tasks after export (e.g., deploy files):

    // config/services.yaml
    Extbaser\Bundle\ExtbaserBundle:
        tags: ['extbaser.post_export_listener']
    
  3. Skip Entities Exclude entities from export via:

    /**
     * @Extbaser\Mapping(skip=true)
     */
    class IgnoredEntity {}
    

Performance Tips

  • Batch Exports: For large projects, export one entity at a time and test incrementally.
  • Cache Generated Files: Use Symfony’s cache system to avoid re-parsing annotations:
    # config/packages/extbaser.yaml
    extbaser:
        cache: true
    
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.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
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