PHPackages                             netliva/symfony-commenter - 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. netliva/symfony-commenter

ActiveSymfony-bundle

netliva/symfony-commenter
=========================

Netliva Symfony Comment Library

v2.2.13(1w ago)285MITPHPPHP ^7.1|^8.0

Since Apr 12Pushed 1w ago1 watchersCompare

[ Source](https://github.com/netliva/symfony-commenter)[ Packagist](https://packagist.org/packages/netliva/symfony-commenter)[ RSS](/packages/netliva-symfony-commenter/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (2)Versions (46)Used By (0)

Symfony İçin Yorum Modülü
=========================

[](#symfony-i̇çin-yorum-modülü)

Projeleriniz içerisinde kullanmak için yorum scriptidir. Jquery, Bootstrap ve Font-awsome'a ihtiyaç duyar.

Kurulum
-------

[](#kurulum)

```
$ composer require netliva/symfony-commenter
```

### Bundle'ı aktifleştir

[](#bundleı-aktifleştir)

config/bundles.php içerisinde

```
return [
    // ...
    Netliva\CommentBundle\NetlivaCommentBundle::class => ['all' => true],
];
```

Assetleri Projeye Dahil Edin
----------------------------

[](#assetleri-projeye-dahil-edin)

### Install assets

[](#install-assets)

Aşağıdaki komut ile assets'lerin kurulumunu gerçekleştirin

`$ php bin/console assets:install`

Bu komut ile; *public/bundles/netlivamedialib* klasörü içerisinde oluşan js ve css dosyalarını projenize dahil ediniz.

```
// assets/js/app.js
import '../../public/bundles/netlivacomment/comment.css'
import '../../public/bundles/netlivacomment/comment'
```

Kullanıcı Entity Sınıf Ayarları
-------------------------------

[](#kullanıcı-entity-sınıf-ayarları)

Kullanıcı sınıfınızın `implements`'lerinde `AuthorInterface` ekleyin ve \_toString fonksiyonunu ekleyin

```
namespace App\Entity;

// ...
use Netliva\CommentBundle\Entity\AuthorInterface;

/**
 * Staff
 */
class Users implements UserInterface, \Serializable, AuthorInterface
{
    // ...
	public function __toString ()
	{
		return $this->getName();
	}
    // ...
}
```

Gerekli ayarları ekleyin;

```
# config/packages/netliva_commenter.yaml
doctrine:
  orm:
    resolve_target_entities:
      Netliva\CommentBundle\Entity\AuthorInterface: App\Entity\Users

# Opsiyonel: yorumlara bırakılan ifadeleri özelleştirmek isterseniz aşağıdakileri ekleyin
netliva_comment:
  emotions:
    like :  { emoji: '👍🏼', color: '#8A6749', desc: 'Beğen' }
    love :  { emoji: '❤️',  color: '#DD2E44', desc: 'Muhteşem' }
    haha :  { emoji: '😂', color: '#DD9E00', desc: 'Hahaha' }
    wow :   { emoji: '😮', color: '#DD9E00', desc: 'İnanılmaz' }
    sad :   { emoji: '😔', color: '#DD9E00', desc: 'Üzgün' }
    angry : { emoji: '😡', color: '#DA2F47', desc: 'Kızgın' }
    # key olarak herhangi bir değer girilebilir
```

```
# config/routes/netliva_commenter.yaml
netliva_comment_route:
    resource: "@NetlivaCommentBundle/Controller/"
    type: annotation
    prefix: /netliva
```

Kullanma
--------

[](#kullanma)

Yorum alanı eklemek istediğiniz yere aşağıdaki örneklerde olduğu gibi twig fonksiyonunu ekleyin.

commentbox("kanal\_tanimi") şeklinde kullanılır. Kanal yorumları gruplandırmaya yarar.

```
// Belli bir sayfanın altında yorumlar
{{ commentbox("page_"~page.id, options) }}

// Ürün yorumları
{{ commentbox("product_"~product.id, options) }}

// Chat alanları
{{ commentbox("room_1", options) }}
```

Options değişkeni key value şeklinde bir dizi değişkendir, aşağıdaki keyler ile değerler gönderilebilir;

KeyTypeVarsayılanAçıklamapredefined\_textsarray\[\]Ön tanımlı metinler tanımlamanızı sağlar. Mesaj yazarken bu metinler arasından seçilebilmesi sağlanır.collaboratorsbooleantrueKatılımcı alanının aktifliğinin ayarlanmasını sağlar. `false` belirlenirse yorum alanı altındaki katılımcılar alanı gösterilmezreactionsbooleantrueYorumlara ifade bırakma özelliğinin aktifliğini sağlarSymfony Events
--------------

[](#symfony-events)

Aşağıda tetiklenen bazı symfony event'ler listelenmiştir. Bu olaylar oluşuğunda kendi kodlarınızın çalışmasını sağlayan subscriber'lar yazabilirsiniz.

### Tetiklenen Olaylar

[](#tetiklenen-olaylar)

Event Key &amp; ClassDescriptionsNetlivaCommenterEvents::AFTER\_ADD `Netliva\CommentBundle\Event\AfterAddCommentEvent`Yorum eklendikten sonra çalışırNetlivaCommenterEvents::AFTER\_ADD\_COLLABORATOR `Netliva\CommentBundle\Event\AfterAddCollaboratorsEvent`Katılımcı eklendikten sonra çalışırNetlivaCommenterEvents::COMMENT\_BOX `Netliva\CommentBundle\Event\CommentBoxEvent`Yorum alanı oluşturulurken çalışırNetlivaCommenterEvents::AFTER\_REACTION `Netliva\CommentBundle\Event\AfterAddReactionEvent`İfade bıraktıktan sonra çalışırNetlivaCommenterEvents::USER\_IMAGE `Netliva\CommentBundle\Event\UserImageEvent`Kullanıcının profil fotoğrafına ulaşmak istendiğinde çalışır### Subscribe Oluşturma

[](#subscribe-oluşturma)

```
# aşağıdaki kodu service dosyanıza ekleyin
services:
    # ...
    my_comment_box_user_image_subscriber:
        class: App\EventListener\CommentBoxUserImageSubscriber
        arguments: [ "@service_container", "@doctrine.orm.entity_manager", "@security.token_storage" ]
        tags:
            - { name: kernel.event_subscriber }
```

```
namespace App\EventListener;

use Doctrine\ORM\EntityManagerInterface;
use Netliva\CommentBundle\Event\NetlivaCommenterEvents;
use Netliva\CommentBundle\Event\UserImageEvent;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;

class CommentBoxUserImageSubscriber implements EventSubscriberInterface
{
    public function __construct () { }

    public static function getSubscribedEvents ()
    {
        return [
            NetlivaCommenterEvents::USER_IMAGE => 'getUserImage'
        ];
    }

    public function getUserImage (UserImageEvent $event)
    {
        // Kullanıcı mülküne ulaşın
        $user = $event->getAuthor();

        // kullanıcının profil fotoğrafının resmine ulaşın
        $imgPath = $user->getPhoto();

        if (!$imgPath || !file_exists($imgPath))
            return null;

        // fotoğrafın yolunu set edin, böylece gerekli yerlerde kullanıcı fotoğrafları gösterilir
        $event->setImage($imgPath);
    }

}
```

Js Events
---------

[](#js-events)

Aşağıda tetiklenen bazı jquery olaylar listelenmiştir. Bu olaylar oluşuğunda kendi kodlarınızın çalışmasını sağlayabilirsiniz.

### Tetiklenen Olaylar

[](#tetiklenen-olaylar-1)

#### netliva:commenter:init

[](#netlivacommenterinit)

Yorum gönderme alanı oluştuktan hemen sonra tetiklenir.

```
$(document).on("netliva:commenter:init", function(event, $comment_area, commenter){
    // $comment_area : Yorum alanı jQuery öğesi
    // commenter : Yorum aksiyonlarının yer aldığı javascript nesnesi
});
```

#### netliva:commenter:initline

[](#netlivacommenterinitline)

Yorum satırları oluştuktan hemen sonra tetiklenir.

```
$(document).on("netliva:commenter:initline", function(event, $comment_line, commenter){
    // $comment_line : Yorum satırı jQuery öğesi
    // commenter : Yorum aksiyonlarının yer aldığı javascript nesnesi
});
```

#### netliva:commenter:send:click

[](#netlivacommentersendclick)

Yorum gönderimi anında tetiklenir

```
$(document).on("netliva:commenter:send:click", function(event, $comment_area, commenter){
    // $comment_area : Yorum alanı jQuery öğesi
    // commenter : Yorum aksiyonlarının yer aldığı javascript nesnesi
});
```

#### netliva:commenter:send:complete

[](#netlivacommentersendcomplete)

Yorum gönderimi tamamlanınca tetiklenir

```
$(document).on("netliva:commenter:send:complete", function(event, $comment_area, jqXHR, textStatus, commenter){
    // $comment_area : Yorum alanı jQuery öğesi
    // jqXHR : jQuery ajax sonucu dönen XMLHttpRequest nesnesi (https://api.jquery.com/jQuery.ajax/#jqXHR)
    // textStatus : Dönen sonucun durumunu kategorize eden bir dize ("success", "notmodified", "nocontent", "error", "timeout", "abort", or "parsererror")
    // commenter : Yorum aksiyonlarının yer aldığı javascript nesnesi
});
```

#### netliva:commenter:send:success

[](#netlivacommentersendsuccess)

Yorum gönderim sonucu başarılıysa tetiklenir

```
$(document).on("netliva:commenter:send:success", function(event, $comment_area, response, textStatus, jqXHR, commenter){
    // $comment_area : Yorum alanı jQuery öğesi
    // response : ajax sonrası dönen yanıt
    // jqXHR : jQuery ajax sonucu dönen XMLHttpRequest nesnesi (https://api.jquery.com/jQuery.ajax/#jqXHR)
    // commenter : Yorum aksiyonlarının yer aldığı javascript nesnesi
});
```

#### netliva:commenter:send:error

[](#netlivacommentersenderror)

Yorum gönderim sonucu hatalıysa tetiklenir

```
$(document).on("netliva:commenter:send:error", function(event, $comment_area, jqXHR, textStatus, commenter){
    // $comment_area : Yorum alanı jQuery öğesi
    // jqXHR : jQuery ajax sonucu dönen XMLHttpRequest nesnesi (https://api.jquery.com/jQuery.ajax/#jqXHR)
    // commenter : Yorum aksiyonlarının yer aldığı javascript nesnesi
});
```

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance98

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~52 days

Recently: every ~62 days

Total

43

Last Release

9d ago

Major Versions

v0.0.9 → v1.0.02020-12-15

v1.0.8 → v2.0.02023-10-26

v1.1.1 → v2.0.12024-01-14

v1.1.3 → v2.2.32024-03-14

v1.1.4 → v2.2.52024-04-24

PHP version history (2 changes)v0.0.0PHP ^7.1.3

v1.1.1PHP ^7.1|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/a4cb778a87e686e366f216a65c7ac3818b727566c2fb1a70ebf807970aa6b3b3?d=identicon)[bilalyilmax](/maintainers/bilalyilmax)

---

Top Contributors

[![bilalyilmax](https://avatars.githubusercontent.com/u/10108441?v=4)](https://github.com/bilalyilmax "bilalyilmax (84 commits)")

### Embed Badge

![Health badge](/badges/netliva-symfony-commenter/health.svg)

```
[![Health](https://phpackages.com/badges/netliva-symfony-commenter/health.svg)](https://phpackages.com/packages/netliva-symfony-commenter)
```

###  Alternatives

[scheb/2fa

Two-factor authentication for Symfony applications (please use scheb/2fa-bundle to install)

578630.7k1](/packages/scheb-2fa)[stfalcon/tinymce-bundle

This Bundle integrates TinyMCE WYSIWYG editor into a Symfony2 project.

2692.9M24](/packages/stfalcon-tinymce-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[symfony/ai-bundle

Integration bundle for Symfony AI components

30282.3k6](/packages/symfony-ai-bundle)[rikudou/psr6-dynamo-db-bundle

PSR-6 and PSR-16 cache implementation using AWS DynamoDB for Symfony

2077.8k](/packages/rikudou-psr6-dynamo-db-bundle)[leapt/core-bundle

Symfony LeaptCoreBundle

2529.1k4](/packages/leapt-core-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
