Git Product home page Git Product logo

akka-cakephp-feedback-plugin's Introduction

CakePHP 3 Feedback Plugin

Join the chat at https://gitter.im/akkaweb/AKKA-CakePHP-Feedback-Plugin

A CakePHP 3 Plugin used in conjunction with the jQuery Sliiide Plugin that allows easy implementation of a feedback system within a website. Feedback will collect the following: name, email, feedback, IP, browser and referrer.

This plugin can be seen in action at this website: https://www.kidzwl.com

Total Downloads License

Requirements

  • CakePHP 3
  • PHP 5.4.6+
  • jQuery

NOTE: Sliiide jQuery Plugin is also needed, but it is included and loaded by the Feedback Plugin. More details about this plugin can be found here: https://github.com/ahmedrad/sliiide

Included

  • Feedback Helper

Installation

Composer

Run the following Composer command from the root of your application

php composer.phar require akkaweb/cakephp-feedback

Or Add the following to your composer.json file located in the root of your application, in the require section . ie. /var/www/domain.com/composer.json

"require": {
	"akkaweb/cakephp-feedback": "2.0.*"
}

Then run the following command at the root of your application

php composer.phar update

Note: if composer.phar is not found, you need to install it. Follow CakePHP's documentation here -> http://book.cakephp.org/3.0/en/installation.html. Refer to Installing Cakephp section

Configuration

Load the plugin in your application's bootstrap.php file:

Using command-line

bin/cake plugin load -r AkkaFeedback

or

Plugin::load('AkkaFeedback', ['bootstrap' => false, 'routes' => true]);

Schema Migrations

This Feedback plugin uses the feedbacks database table to save feedbacks. Please use the following command to run the migrations file included

bin/cake migrations migrate -p AkkaFeedback

If you would rather create this table directly using phpMyAdmin, Workbench or other Database Tools, you can use the file provided in AkkaFeedback/config/Schema/feedback.sql

Load the plugin's helper in src/View/AppView.php inside the initialize() hook method

parent::initialize();
$this->loadHelper('AkkaFeedback.Feedback');

Add Default Element to your Layout file

Add the following to the bottom of your layout file right before the end body tag </body>

<?php echo $this->Element('AkkaFeedback.feedback_form'); ?>

NOTE: You need to ensure the following is also added within the tag of your application

	<?= $this->fetch('css') ?>
	<?= $this->fetch('script') ?>

Adding reCaptacha to Forms

To enabled reCaptacha in your forms, you need to add the following to application bootstrap files. ie. bootstrap.php.

Configure::write('Feedbacks.reCaptcha.enable', true); //to enable reCatpcha login Configure::write('Feedbacks.reCaptcha.key', 'xxxxxxxxxxxxxxxxxxxx'); //reCatpcha key Configure::write('Feedbacks.reCaptcha.secret', 'xxxxxxxxxxxxxxxxxxxx'); //reCatpcha secret

At this point the default Feedback Form will start showing on your site.

If you would like a different form, you can copy this element, make the necessary changes and create a new element in your application's Element folder

Administration

This plugin comes with a set of controller files that allows an administrator to view Feedbacks added to the site using the admin prefix.

The preferred method is thru using src/Controller/Admin/FeedbacksController.php which requires your application to have an AdminsController.php but the file src/Controller/FeedbacksController.php also includes prefixed admin actions. ie admin_index.

By default the plugin provides the following route that allows the following URLs to be accessible:

    /admin/feedbacks
    /admin/feedbacks/index ([/edit/:id] and [/view/:id])

Disclaimer

Although we have done many tests to ensure this plugin works as intended, we advise you to use it at your own risk. As with anything else, you should first test any addition to your application in a test environment. Please provide any fixes or enhancements via issue or pull request.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.