kitpages / user-generated-bundle
此插件提供了一种在网站任何内容上添加评论的方法。
v2.1.0BETA3
2012-10-11 14:53 UTC
Requires
- doctrine/orm: >=2.1.0
- symfony/framework-bundle: 2.1.*
This package is auto-updated.
Last update: 2024-09-04 19:33:21 UTC
README
用于常见用户生成内容,如评论、评分等...
目前只有以下功能的评论
- 审核
- 发送邮件给网站管理员
URL: http://www.kitpages.fr/fr/cms/108/kitpagesusergeneratedbundle (法语)
当前状态
测试版
即将推出
- 管理界面
安装
如果你使用 DEPS
[gedmo-doctrine-extensions]
git=http://github.com/l3pp4rd/DoctrineExtensions.git
target=/gedmo-doctrine-extensions
[StofDoctrineExtensionsBundle]
git=https://github.com/stof/StofDoctrineExtensionsBundle.git
target=/bundles/Stof/DoctrineExtensionsBundle
[KitpagesUtilBundle]
git=https://github.com/kitpages/KitpagesUtilBundle.git
target=/bundles/Kitpages/UtilBundle
[KitpagesUserGeneratedBundle]
git=https://github.com/kitpages/KitpagesUserGeneratedBundle.git
target=/bundles/Kitpages/UserGeneratedBundle
将 Kitpages
命名空间添加到你的自动加载器
<?php // app/autoload.php $loader->registerNamespaces(array( // ... 'Gedmo' => __DIR__.'/../vendor/gedmo-doctrine-extensions/lib', 'Stof' => __DIR__.'/../vendor/bundles', 'Kitpages' => __DIR__.'/../vendor/bundles', ));
在您的内核中启用插件
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(), new Kitpages\UtilBundle\KitpagesUtilBundle(), new Kitpages\UserGeneratedBundle\KitpagesUserGeneratedBundle(), ); }
导入路由文件
# app/config/routing.yml KitpagesUserGeneratedBundle: resource: "@KitpagesUserGeneratedBundle/Resources/config/routing.xml"
配置 KitpagesUserGenerated
# app/config/config.yml kitpages_user_generated: comment: default_status: "validated" from_email: "webmaster@mywebsite.fr" admin_email_list: ["admin@mywebsite.fr"]
配置 StofDoctrineExtensionsBundle
# app/config/config.yml stof_doctrine_extensions: default_locale: en_US orm: default: timestampable: true sortable: true sluggable: true tree: true
然后更新您的数据库模式
php app/console doctrine:schema:update
用户指南
如果你想在指定页面添加评论系统,你应该在你的 twig 模板中添加以下代码
<h3>Form to add a comment</h3> {% render 'KitpagesUserGeneratedBundle:Comment:newPost' with { 'itemReference': 'myItem' } %} <h3>commentList</h3> {% render 'KitpagesUserGeneratedBundle:Comment:displayPostList' with { 'itemReference': 'myItem' } %}
"itemReference" 参数是评论列表的引用。例如,如果你想在商店的产品 #45 上添加评论,你可以使用 "product-45" 作为 itemReference