andchir / shopkeeper4-comments
Symfony4 的评论和评分
1.0.15
2021-06-20 21:20 UTC
Requires
README
可以在 Shopkeeper4 及其他使用 Symfony 4 的应用程序中使用。使用 DoctrineMongoDBBundle 4+。
安装
composer config extra.symfony.allow-contrib true
composer require andchir/shopkeeper4-comments
使用 Andchir\CommentsBundle\Document\CommentAbstract
和 Andchir\CommentsBundle\Repository\CommentRepositoryInterface
创建您实体的类,或者使用这些示例
vendor/andchir/shopkeeper4-comments/Document/Comment.php.dist
vendor/andchir/shopkeeper4-comments/Repository/CommentRepository.php.dist
添加到您的 Twig 模板中
{% block stylesheets -%}
{{ parent() }}
<link href="{{ asset('bundles/comments/css/comments.css') }}" rel="stylesheet">
{% endblock -%}
您的块名称可能不同。
{% include '@Comments/Default/async.html.twig' with {'threadId': currentCategory.contentTypeName ~ '_' ~ currentId} only %}
安装 Shopker 组件
添加到配置文件 config/resources/admin_menu.yaml
- { title: 'COMMENTS', route: '/module/comments', icon: 'icon-message-circle' }
打开 "src/App/Repository/CommentRepository.php" 并替换
class CommentRepository extends DocumentRepository implements CommentRepositoryInterface
为
class CommentRepository extends BaseRepository implements CommentRepositoryInterface
手动安装
composer.json
"autoload": {
"psr-4": {
...
"Andchir\\CommentsBundle\\": "vendor/andchir/shopkeeper4-comments/"
}
},
config/bundles.php
Andchir\CommentsBundle\CommentsBundle::class => ['all' => true]
开发
创建符号链接
ln -s /path/to/vendor/andchir/shopkeeper4-comments/frontend/projects/comments/src/app \
/path/to/frontend/projects/admin2/src/app/comments
为开发模式构建
ng build comments --optimization false --build-optimizer false --source-map true \
--baseHref="/admin/module/comments/" \
--deployUrl="/bundles/comments/admin/bundle-dev/" \
--outputPath="../public/bundles/comments/admin/bundle-dev" --watch=true
为生产构建
ng build comments --configuration production --baseHref="/admin/module/comments/" \
--deployUrl="/bundles/comments/admin/bundle/" \
--outputPath="../public/bundles/comments/admin/bundle"