lukabutina / h5p-custom-bundle
适用于 Symfony 4 和 Symfony 5 的 H5P Bundle
dev-master
2021-02-10 09:16 UTC
Requires
- php: ^7.2.5
- doctrine/doctrine-bundle: 1.9.1
- doctrine/orm: ^2.4.0
- guzzlehttp/guzzle: ^6.5
- h5p/h5p-core: ^1.24
- h5p/h5p-editor: ^1.24
- symfony/asset: ~4.0|~5.0
- symfony/framework-bundle: ~4.0|~5.0
- symfony/security-bundle: ~4.0|~5.0
- symfony/serializer: ~4.0|~5.0
- twig/extra-bundle: ^3.0
This package is auto-updated.
Last update: 2024-09-10 17:29:41 UTC
README
将 H5P 集成到 Symfony 的 Bundle。此 Bundle 是 H5P Drupal 模块的移植版本。有关 H5P 的更多信息,请参阅 H5P.org
对于 Symfony 3.X => H5PBundle for Symfony 2.X 和 3.X
此 Bundle 在 Symfony 4.X 和 Symfony 5.X 上进行了测试
安装
使用 composer 安装
composer require jorisdugue/h5p-bundle
在 AppKernel.php
中启用 Bundle
return [ // ... \Studit\H5PBundle\StuditH5PBundle::class => ['all' => true] ]
Windows 注意:您需要以管理员身份启动 cmd
将 H5P 资产添加到 Bundle
php bin/console h5p-bundle:IncludeAssetsCommand php bin/console assets:install --symlink
并重新执行 ...
php bin/console h5p-bundle:IncludeAssetsCommand
将所需的表和关系添加到数据库
php bin/console doctrine:schema:update --force
或
php bin/console make:migrations
在 routes.yaml
中启用路由
studit_h5p.demo: resource: "@StuditH5PBundle/Resources/config/routing_demo.yml" prefix: / studit_h5p: resource: "@StuditH5PBundle/Resources/config/routes.yaml" prefix: /
studit_h5p.demo 是可选的。它可以用作在 Symfony 中使用 H5P 的示例,并测试此 Bundle 是否正常工作。
配置
对于 SF4:在 services.yaml
中配置 Bundle。 (注意 h5 和 p 之间的下划线)
parameters: studit_h5_p: use_permission: true # This is false by default to let the demo work out of the box. storage_dir: / # Location to store all H5P libraries and files web_dir: public # Location of the public web directory export: 3 #for all embed: 3 #for all
对于 Symfony 5:在 packages > h5pBundle.yml
中配置 Bundle。
studit_h5_p: use_permission: true # This is false by default to let the demo work out of the box. storage_dir: / # Location to store all H5P libraries and files web_dir: public # Location of the public web directory export: 3 #for all embed: 3 #for all
有关所有配置信息,请参阅 Configuration.php
如果您正在使用权限,以下是 Bundle 中的当前权限列表
使用方法
首先添加一个虚拟主机,指向您的项目。然后在浏览器中访问 http://<your virtualhost>/h5p/list
待办事项
正在工作
- 存储使用数据和分数(只有当用户登录时)
- 下载 H5P
- 上传 H5P
- 更新 / 安装 H5P 库
- 存储使用数据和分数
并非所有内容都已移植。以下内容还需要完成
- 上传库。目前只能从 Hub 选择 H5P 默认库。 (需要自定义 h5p 进行测试)
变更日志
- 修复错误并更新 README
- 修复许多错误 ... 并升级到 SF5 :)
- 修复缺少链接图片的错误
- 修复下载包
- 存储使用数据和分数