omnibridge / twig
The Twig side of omnibridge: the contract a page rendered with Twig asks of any framework (path, url, asset, trans - omnisense/omnibridge's Urls and Translations), the Twig extension that provides it where the framework does not, and helpers.
Requires
- php: >=8.2
- omnisense/omnibridge: ^1.0
- twig/twig: ^3.10
Requires (Dev)
- omnisense/omnimap: ^1.0@dev
- phpunit/phpunit: ^11.5
Suggests
- omnisense/omnimap: Omnibridge\Twig\MapExtension: omnimap(view), omnimap_export(), omnimap_suppress() - a map's picture kept in the cache or the live map, and the buttons that change it
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-26 10:05:09 UTC
README
The small contract a page rendered with Twig asks of any framework, so the same template renders under Symfony, Laravel or plain PHP (plan 0, rule 13: a screen is described once, a view bridge renders it).
- The contract is omnisense/omnibridge's, the family's core:
Omnibridge\Contract\Urls(path(name, parameters),url(name, parameters),asset(path)) andOmnibridge\Contract\Translations(trans(id, parameters, domain, locale)on ICU catalogues,exists(id, domain, locale)). ContractExtension: registerspath(),url(),asset()and thetransfilter under the names Symfony gives them. Symfony already has them and does not register it; another framework registers it with its own answers to the contract.AccessExtension:is_granted(attribute, subject)onOmnibridge\Contract\Accessandcsrf_token(intent)onOmnibridge\Contract\Tokens, under Symfony's names. Every host registers it, Symfony included (omnibridge/symfony, after twig-bridge's own, which it then answers with the same services): a page asks the same code under either framework. A contract the host does not bind leaves its function out.MapExtension(with omnisense/omnimap, suggested):omnimap(view)- the picture of a map kept in omnimap's cache, or the live map, by omnimap'sMapPrinterrule -,omnimap_export(view, attributes)andomnimap_suppress(view, attributes)- the buttons that change the cache, for whoever the host'sAccessgrants the control attribute (ROLE_ADMIN), posting aTokenstoken to the host's map cache routes -,omnimap_signature(view). omnibridge/symfony and omnibridge/laravel register it when omnimap is configured.HelperExtension: the filters omnibase's templates use that are not Twig's own.
The former names Omnibridge\Twig\Contract\Urls and Omnibridge\Twig\Contract\Translations,
aliases of omnisense/omnibridge's interfaces since its step A2, were removed at omnibase 4's
final pass: name Omnibridge\Contract\Urls and Omnibridge\Contract\Translations.
Pilot: lesringostars' article screen (~/.claude/plans/lesringostars-deux-cadres.md).