- What is kharhamel/office-template-engine-bundle?
- It is a Symfony bundle that integrates the kharhamel/office-template-engine library into Symfony applications. It registers the engine with Symfony's service container so you can generate office documents from templates using dependency injection and familiar bundle configuration. The bundle is a thin integration layer, so most document-generation behavior comes from the underlying engine.
- Does kharhamel/office-template-engine-bundle work with Laravel?
- Not natively. It is built as a Symfony bundle, so it relies on Symfony's bundle registration and dependency injection rather than Laravel's service provider and facade system. Laravel developers can still use the underlying kharhamel/office-template-engine package directly and wire it manually in a service provider, but the bundle itself is not a drop-in Laravel package.
- How do I install kharhamel/office-template-engine-bundle?
- Install it with Composer using composer require kharhamel/office-template-engine-bundle. In a Symfony Flex application the bundle is usually registered automatically; otherwise add it to config/bundles.php. Check the repository README for any additional setup steps or required configuration.
- How do I configure the Office Template Engine bundle?
- Configuration is intentionally minimal because the bundle's job is to expose the Office Template Engine as Symfony services. You typically enable the bundle and then inject the relevant service into your controllers or application services. Refer to the package README for exact configuration keys and service IDs, since those details belong to the bundle and can change.
- How do I generate an office document from a template with this bundle?
- Use Symfony dependency injection to obtain the template engine service, point it at your template file, and render the document with your data. The blurb describes service-based workflows, so the intended pattern is injection rather than static calls. The exact method names and template data format are defined by kharhamel/office-template-engine, so check its API docs.
- Which document formats does the Office Template Engine support?
- The bundle itself does not implement document formats; it delegates to kharhamel/office-template-engine. Format support therefore depends on that underlying library and any optional dependencies it requires. Check the engine's documentation for the authoritative list of supported office document types.
- What PHP and Symfony versions are required?
- The context does not list specific version constraints, so verify the composer.json requirements for both the bundle and the underlying engine. As a Symfony bundle, it needs a Symfony application version compatible with its service definitions. PHP compatibility will be whatever both packages declare on Packagist.
- How should I test document generation with this bundle?
- Write an integration test that boots the Symfony kernel, injects the engine service, renders a small template, and asserts that the output file exists and is non-empty. For more confidence, validate key content or compare against a known-good fixture when the output format is deterministic. Unit tests are less useful here because the bundle mostly wires services.
- Is kharhamel/office-template-engine-bundle safe for production use?
- It is a thin Symfony integration, so production risk is mostly inherited from the underlying engine and your template handling. Validate uploaded templates, control temp-file permissions, handle rendering errors, and watch memory usage for large documents. Review the repository's recent commits, issues, and test coverage before relying on it for critical workflows.
- What are alternatives to this bundle and is it actively maintained?
- Alternatives include using kharhamel/office-template-engine directly without the Symfony bundle, PHPOffice libraries such as PHPWord, PhpSpreadsheet, and PhpPresentation, or Laravel-specific document generation packages. Maintenance should be checked on the GitHub repository via recent commits, releases, and open issues, since small integration bundles often track the underlying library rather than shipping frequent updates.