PHPackages                             nitronet/fwk-comments - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. nitronet/fwk-comments

ActiveLibrary

nitronet/fwk-comments
=====================

08PHP

Since Dec 3Pushed 11y ago1 watchersCompare

[ Source](https://github.com/nitronet/fwk-comments)[ Packagist](https://packagist.org/packages/nitronet/fwk-comments)[ RSS](/packages/nitronet-fwk-comments/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

fwk-comments
============

[](#fwk-comments)

Adds Comments management to [Fwk\\Core](https://github.com/fwk/Core) Applications.

Installation
------------

[](#installation)

### 1: Install the sources

[](#1-install-the-sources)

Via [Composer](http://getcomposer.org):

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

```

If you don't use Composer, you can still [download](https://github.com/nitronet/fwk-comments/zipball/master) this repository and add it to your `include_path` [PSR-0 compatible](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md)

### 2: Configure Plugin

[](#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!

[](#4-thats-it)

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

#### Displaying thread

[](#displaying-thread)

```
