offline/oc-opening-hours-plugin
Composer 安装命令:
composer require offline/oc-opening-hours-plugin
包简介
Manage and display opening hours on your website
关键字:
README 文档
README
Manage and display opening hours on your website.
Features
This plugins allows you to store opening hours for multiple locations and display them on your website.
It makes use of the great spatie/opening-hours library. You have direct access to all of the library's features.
- Store opening hours for multiple locations
- Set opening hours for each day of the week
- Add exceptions for specific dates
- Display the opening hours on your website
- Schema.org compatible example markup provided
OpeningHours component
This plugin provides only a single OpeningHours component. It can be used to display all opening hours for all locations.
[openingHours] == {# List all locations #} {% for location in openingHours.locations %} {{ dump(location.openingHours.forWeek()) }} {% endfor %} {# If you have only a single location you can access it directly #} {{ dump(openingHours.location.openingHours.forWeek()) }} {# You can also access a specific location by its slug #} {{ dump(openingHours.locationsBySlug['your-location'].openingHours.forWeek()) }}
Access the openingHours property on any location to have access to the full spatie/opening-hours
featureset as documented in their README.
{{ dump(location.openingHours.forWeek()) }}
{{ dump(location.openingHours.forWeekCombined()) }}
{{ location.openingHours.asStructuredData() | json_encode }}
{{ location.openingHours.forDay('monday') }}
{{ location.openingHours.isOpenOn('monday') ? 'open' : 'closed' }}
{{ location.openingHours.isClosedOn('monday') ? 'closed' : 'open' }}
{{ location.openingHours.forDate(date('2020-01-01')) }}
{{ location.openingHours.isOpenAt(date('2020-10-01')) ? 'open' : 'closed' }}
{{ location.openingHours.isOpen() ? "We're open!" : "Sorry, we're closed!" }}
{{ location.openingHours.isClosed() ? "Sorry, we're closed!" : "We're open!" }}
{{ "Open until " ~ location.openingHours.nextClose(date('now')).format('Y-m-d H:i') }}
{{ "We'll open again on " ~ location.openingHours.nextOpen(date('now')).format('Y-m-d H:i') }}
Checkout the component's partials for a demo implementation.
Contributing
Bugs and feature requests
If you found a bug or want to request a feature please file a GitHub issue.
Pull requests
PRs are always welcome! Open them against the master branch.
If you plan a time consuming contribution please open an issue first and describe what changes you have in mind.
offline/oc-opening-hours-plugin 适用场景与选型建议
offline/oc-opening-hours-plugin 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 500 次下载、GitHub Stars 达 5, 最近一次更新时间为 2019 年 07 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「cms」 「october」 「opening hours」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 offline/oc-opening-hours-plugin 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 offline/oc-opening-hours-plugin 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 offline/oc-opening-hours-plugin 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
User plugin for October CMS
Package to access the Opening Hours API and wrap the responses in value objects.
Laravel Horizon integration for October CMS
GraphQL authentication for your headless Craft CMS applications.
DateTime and business hours (opening, closing times) calculations
Set Links with a specific language parameter
统计信息
- 总下载量: 500
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 18
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-07-12