Skip to content

Installation

phil/opening-hours-bundle
RequirementVersionWhy
PHP8.5 or laterThe floor the bundle declares
ext-intlanyDays, dates and times written by ICU
ext-mbstringanyDay names with a capital in any script
phil/opening-hours^0.1@devThe hours
psr/clock^1.0Now, for Twig; the container's clock service, which FrameworkBundle registers once symfony/clock is installed
symfony/form, symfony/options-resolver^8.2The form
symfony/dependency-injection, symfony/config^8.2The bundle class and its configuration
doctrine/dbaloptionalThe column type phil_opening_hours
twig/twigoptionalThe functions and the table template
symfony/clockrequired with TwigThe clock service the functions read now from
composer require phil/opening-hours-bundle
// config/bundles.php
return [
    // ...
    Phil\OpeningHoursBundle\PhilOpeningHoursBundle::class => ['all' => true],
];

Configuration

phil_opening_hours:
    # The time zone new hours are kept in, an IANA identifier; UTC by default.
    default_timezone: America/Toronto

Twig's functions read now from the service clock — symfony/clock's, with FrameworkBundle. With Twig installed, that service is required: the bundle never falls back to the system's time, and a container without it does not compile, naming the missing clock service.