An open API service indexing awesome lists of open source software.

https://github.com/sensorario/sensorariocommentbundle

My first attempt to make a bundle for symfony2
https://github.com/sensorario/sensorariocommentbundle

Last synced: about 1 year ago
JSON representation

My first attempt to make a bundle for symfony2

Awesome Lists containing this project

README

          

Requirements
============

This bundle use jquery. To include it use:

Register Sensorario Namespace
=============================

$loader->registerNamespaces(array(
....
'Sensorario' => __DIR__.'/../vendor/bundles',
....
));

Add Bundle to AppKernel
=======================

class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
...
new Sensorario\CommentBundle\SensorarioCommentBundle(),
...
);
}

...
}

Install
=======

Update your deps file

[SensorarioCommentBundle]
git=git://github.com/sensorario/SensorarioCommentBundle.git
target=/bundles/Sensorario/CommentBundle

And install this vendor

$ php bin/vendors install

Update your DB schema with Doctrine
===================================

If you want, can add migrations for update your database.
SensorarioCommentBundle use Comment entity to store comments. So, you must
update your database before start to use this bundle.

$ php app/console doctrine:migrations:diff
$ php app/console doctrine:migrations:migrate

Also, you can update your database schema with:

$ php app/console doctrine:schema:update --force

Install assets
==============

Run this command:

$ php app/console assets:install web/

Add routing
===========

Add this in routing.yml

SensorarioCommentBundle:
resource: "@SensorarioCommentBundle/Controller/"
type: annotation
prefix: /

Usage
=====

Just put this snippet of code on your pages, to comment them. And just remember
to change "unique_id" for each different "thread".

{% render 'SensorarioCommentBundle:Index:index' with {'unique_id': 'home_page'} %}

Nice gui with Twitter Bootstrap
===============================

Also, if you like, can override comments.html.twig template with this. This
template add some icons. Like a trash for delete a comment, a "user" icon near
username, and a clock near comment datetime creation.


{% for commento in comments %}


{{ commento.getCreationDate|date("d/m/Y") }}

{{ commento.author }}: {{ commento.comment }}








{% endfor %}