fitratech/sylius-facebook-messenger

该包已被弃用,不再维护。作者建议使用 fitratech/sylius-facebook-messenger-plugin 包。

一个用于在 Sylius 中集成 Facebook Messenger 聊天窗口的插件。


README

68747470733a2f2f6669747261746563682e636f6d2f696d616765732f6c6f676f2e706e67      68747470733a2f2f64656d6f2e73796c6975732e636f6d2f6173736574732f73686f702f696d672f6c6f676f2e706e67

Facebook Messenger

一个用于嵌入 Sylius 聊天窗口的 Facebook Messenger 插件。

功能

启用聊天窗口 & 从后台设置页面 ID

enable the chat box & set the page id from the back office

通过模板事件直接注入聊天窗口

inject the chat box directly via template event inject the chat box directly via template event

安装

需要插件
composer require fitratech/sylius-facebook-messenger

如果你使用 Symfony Flex,请跳过修改 bundles.php。

修改 config/bundles.php 并在末尾添加此行

    FitraTech\SyliusFacebookMessengerPlugin\FitraTechSyliusFacebookMessengerPlugin::class => ['all' => true],

使用

  1. 你的 Channel 实体需要实现 FitraTech\SyliusFacebookMessengerPlugin\Model\ChannelInterface 接口并使用 FitraTech\SyliusFacebookMessengerPlugin\Model\ChannelTrait 特性。

  2. 你需要运行 doctrine 迁移的差异: bin/console doctrine:migrations:diff。别忘了运行它!(bin/console doctrine:migrations:migrate)

  3. 覆盖 SyliusAdminBundle/Channel/_form.html.twig (如果你不熟悉模板覆盖,请检查 官方文档)并包含 @FitraTechSyliusFacebookMessengerPlugin/Channel/form.html.twig

    <div class="ui hidden divider"></div>
    {% include '@FitraTechSyliusFacebookMessengerPlugin/Channel/form.html.twig' %}
    

前端定制

你可以在你的主题中覆盖聊天窗口模板(src/FitraTechSyliusFacebookMessengerPlugin/Resources/views/embed.html.twig

本地开发

Facebook Messenger 聊天窗口需要完全限定域名(FQDN),localhost 及 ip 无效,如果你使用 symfony cli,需要设置本地域名,请遵循 官方文档这篇博客文章