atm/boardbundle

板组

安装: 215

依赖者: 0

建议者: 0

安全性: 0

类型:symfony-bundle

2.27 2021-06-11 08:08 UTC

This package is auto-updated.

Last update: 2024-09-11 15:24:06 UTC


README

通过composer安装

php -d memory_limit=-1 composer.phar require atm/boardbundle

在你的AppKernel中

public function registerbundles()
{
    return [
    	...
    	...
    	new ATM\BoardBundle\ATMBoardBundle(),
    ];
}

配置示例

# app/config/config.yml
  
atm_board:
    media_folder: Media folder.
    user: Your user namespace.
    image_width: width of the post image.
    image_height: height of the post image.
    watermark_image_small: small watermark path.
    watermark_image_medium: medium watermark path.
    watermark_image_big: big watermark path.
    encoder_api_key: encoder api key from qencode.
    encoder_profile_id: encoder profile id from qencode.
    encoder_transfer_method_id: encoder profile id from qencode.
    not_access_redirect_route: Redirect route when a user has no access to the board.
    after_request_access_redirect_route: Redirect route after a request has sent to a user.
    added_to_acl_redirect_route: Redirect route after a user is added to the acl.
    removed_to_acl_redirect_route: Redirect route after a user is removed to the acl.

路由

追加到主路由文件

# app/config/routing.yml

atm_board:
    resource: "@ATMBoardBundle/Controller/BoardController.php"
    type:     annotation
    prefix:   /

atm_board_admin:
    resource: "@ATMBoardBundle/Controller/AdminController.php"
    type:     annotation
    prefix:   /

使用方法

首先使用以下路由创建一个板

    {{ path('atm_board_create')

一旦你的板创建成功,你可以添加帖子图片、视频和文本。对于视频,你需要在控制台中启动rabbitMQ队列

- atm_board_encode_video:execute

访问控制列表(ACL)

板系统还允许给板的所有者想要给予访问权限的用户。首先,想要访问你的板的人必须使用此路由向你发送请求

    {{ path('atm_board_request_access') }}

此路由的操作将触发以下事件

    atm_board_request_access.event

在该事件中,你可以自定义板所有者获取添加想要查看板的人的链接的方式。这是将用户添加到板的ACL的路由

    {{ path('atm_board_add_user_acl',{ 'boardId':board.id, 'userId':user.id }) }}

将用户添加到板的ACL后,将触发以下事件,其中板ID和添加到板ACL的用户ID作为参数

    atm_board_added_acl.event

如果板所有者想要从其板上移除用户,这是进行此操作的路径

    {{ path('atm_board_remove_user_acl',{ 'boardId':board.id, 'userId':user.id }) }}

此操作将触发以下事件,其中板ID和从板ACL中移除的用户ID作为参数

    atm_board_deleted_acl.event

管理员

此bundle有自己的管理面板,可以查看所有用户及其板链接,这是管理面板的路径

    {{ path('atm_board_admin_index')