Install the Bundle
Add to composer.json:
"require": {
"edrush/extbaser-bundle": "^1.0"
}
Run:
composer require edrush/extbaser-bundle
Enable the Bundle
Add to config/bundles.php:
return [
// ...
Extbaser\Bundle\ExtbaserBundle::class => ['all' => true],
];
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/.
Next Steps Follow Extbaser’s upload guide to deploy to TYPO3.
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 {}
Generate Extension Run the export command for each entity:
php bin/console extbaser:export my_extension_key --entities=Article,User
Iterate Locally
extbaser:clear to reset generated files before re-exporting.Integrate with TYPO3
rsync or Git).Domain/Model/Article.php) with custom logic.src/ (e.g., Domain/Service/) and reference it in generated templates.@Assert\NotBlank) to auto-generate TYPO3’s validation rules.Resources/views/ and map them via @Extbaser\Template.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/
Annotation Conflicts
use Extbaser\Mapping as Extbaser;
use Doctrine\ORM\Mapping as ORM;
@Extbaser\Mapping is placed after @ORM\Entity.Generated File Overwrites
extbaser:export overwrites files. Use --dry-run to preview changes:
php bin/console extbaser:export my_extension_key --dry-run
TYPO3-Specific Quirks
ext_typoscript_setup.txt and ext_localconf.php. These are generated but may need manual adjustments (e.g., plugin configuration).extbaser:config to customize generated TYPO3 config:
php bin/console extbaser:config my_extension_key --plugin-name="My Plugin"
Circular Dependencies
Article ↔ Author), ensure all are exported in one command or TYPO3’s Extbase will fail to load.-vvv for verbose output:
php bin/console extbaser:export my_extension_key -vvv
php bin/console debug:validator App\Entity\Article
Custom Templates
Override the default Twig templates for export by creating templates/extbaser/ in your bundle.
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']
Skip Entities Exclude entities from export via:
/**
* @Extbaser\Mapping(skip=true)
*/
class IgnoredEntity {}
# config/packages/extbaser.yaml
extbaser:
cache: true
How can I help you explore Laravel packages today?