定制 kitpages/user-generated-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kitpages/user-generated-bundle

Composer 安装命令:

composer require kitpages/user-generated-bundle

包简介

This bundle is an way to add comments on any content of a website.

README 文档

README

Used for common user generated contents like comments, rating,...

For the moment there is only comments with the following features :

  • moderation
  • email to webmaster

URL : http://www.kitpages.fr/fr/cms/108/kitpagesusergeneratedbundle (in french)

Current status

Beta state

comming soon :

  • an administration

Installation

If you are using 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

Add Kitpages namespace to your autoloader :

<?php // app/autoload.php

$loader->registerNamespaces(array(
    // ...
    'Gedmo'     => __DIR__.'/../vendor/gedmo-doctrine-extensions/lib',
    'Stof'      => __DIR__.'/../vendor/bundles',
    'Kitpages'  => __DIR__.'/../vendor/bundles',
));

Enable the bundles in your kernel :

<?php // app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
        new Kitpages\UtilBundle\KitpagesUtilBundle(),
        new Kitpages\UserGeneratedBundle\KitpagesUserGeneratedBundle(),
    );
}

Import the routing file :

# app/config/routing.yml
KitpagesUserGeneratedBundle:
    resource: "@KitpagesUserGeneratedBundle/Resources/config/routing.xml"

Configure KitpagesUserGenerated :

# app/config/config.yml
kitpages_user_generated:
    comment:
        default_status: "validated"
        from_email: "webmaster@mywebsite.fr"
        admin_email_list: ["admin@mywebsite.fr"]

Configure StofDoctrineExtensionsBundle :

# app/config/config.yml
stof_doctrine_extensions:
    default_locale: en_US
    orm:
        default:
            timestampable: true
            sortable: true
            sluggable: true
            tree: true

And then update your database schema :

php app/console doctrine:schema:update

User's guide

If you want to add a comment system in a given page, you should add this code wherever you want in your twig template :

<h3>Form to add a comment</h3>
{% render 'KitpagesUserGeneratedBundle:Comment:newPost' with {
    'itemReference': 'myItem'
} %}
<h3>commentList</h3>
{% render 'KitpagesUserGeneratedBundle:Comment:displayPostList' with {
    'itemReference': 'myItem'
} %}

The "itemReference" parameter is a reference to a comment list. For example if you want comments on the product #45 of your shop, you can use "product-45" as itemReference

统计信息

  • 总下载量: 52
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 7
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD
  • 更新时间: 2012-10-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固