承接 nitronet/fwk-comments 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

nitronet/fwk-comments

Composer 安装命令:

composer require nitronet/fwk-comments

包简介

README 文档

README

Adds Comments management to Fwk\Core Applications.

Installation

1: Install the sources

Via Composer:

{
    "require": {
        "nitronet/fwk-comments": "dev-master",
    }
}

If you don't use Composer, you can still download this repository and add it to your include_path PSR-0 compatible

2: Configure Plugin

First, add some INI configuration to your config.ini file

[services]
comments.service = comments
comments.services.database = db
comments.services.session = session
comments.services.renderer = formRenderer
comments.tables.threads = comments_threads
comments.tables.comments = comments
comments.entities.thread = Nitronet\Fwk\Comments\Model\Thread
comments.entities.comment = Nitronet\Fwk\Comments\Model\Comment
comments.auto.approve = true
comments.auto.thread = true
comments.date.format = Y-m-d H:i:s
comments.form = Nitronet\Fwk\Comments\Forms\AnonymousCommentForm

index.php:

$app->plugin(new CommentsPlugin(array(
    'db'            => $services->getProperty('comments.services.database', 'db'),
    'sessionService'    => $services->getProperty('comments.services.session', 'session'),
    'rendererService'   => $services->getProperty('comments.services.renderer', 'formRenderer'),
    'threadsTable'  => $services->getProperty('comments.tables.threads', 'comments_threads'),
    'threadEntity'  => $services->getProperty('comments.entities.thread', 'Nitronet\Fwk\Comments\Model\Thread'),
    'commentsTable' => $services->getProperty('comments.tables.comments', 'comments'),
    'commentEntity' => $services->getProperty('comments.entities.comment', 'Nitronet\Fwk\Comments\Model\Comment'),
    'commentForm'   => $services->getProperty('comments.form', 'Nitronet\Fwk\Comments\Forms\AnonymousCommentForm'),
    'autoThread'    => $services->getProperty('comments.auto.thread', false),
    'autoApprove'   => $services->getProperty('comments.auto.approve', true),
    'dateFormat'    => $services->getProperty('comments.date.format', 'Y-m-d H:i:s'),
    'serviceName'   => $services->getProperty('comments.service', 'comments')
)));

4: That's it!

You can now use the embed viewHelper in your templates, like so:

Displaying thread

<?= $this->_helper->embed('CommentsThread', array('id' => 'blog:'. $article->getId(), type: 'threaded')); ?>

Displaying Comments count

<?= $this->_helper->embed('CommentsCount', array('id' => 'blog:'. $article->getId())); ?>

Contributions / Community

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD
  • 更新时间: 2014-12-03