Download the PHP package litemerafrukt/postcomments without Composer
On this page you can find all versions of the php package litemerafrukt/postcomments. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download litemerafrukt/postcomments
More information about litemerafrukt/postcomments
Files in litemerafrukt/postcomments
Package postcomments
Short Description litemerafrukt postcomments module.
License MIT
Homepage http://litemerafrukt.se
Informations about the package postcomments
Anax postcomments
Reddit-like comments to posts.
Uses view-files recursively to achieve nested comments. There are default view files. If you want to define your own views then look at the included view files for examples. The Comments
class takes a top level view file as optional parameter.
CommentsHandler
class needs a simple database class with a query
-method. Look at the supplied Database
class for the interface if you want to build your own (which you should). The database needs to be setup with a comments table, se src/extras
folder for schema. Table name can optionally be supplied to CommentsHandler
constructor, defaults to r1_comments
.
This module is built to fit in an Anax project but should fit in to any project with a little work. At the same time, this is not a fit all package, this is written for a specific project.
Install
PHP version > 7.0.
$ composer require litemerafrukt/postcomments
Setup your database with a table for the commments, see vendor/litemerafrukt/postcomments/src/extras
.
Use database class with namespace litemerafrukt\Database
or supply your own class with a query-metod, see vendor/litemerafrukt/postcomments/src/Database/Database.php
for interface.
Usage
Set up your forum post controller to handle both get and post requests. The postcomments module will supply the view with html for the comments.
Example from an Anax project.
License
This software carries a MIT license.