koalabs / feedback
There is no license information available for the latest version (dev-master) of this package.
dev-master
2014-06-18 01:33 UTC
Requires
- php: >=5.3.0
- illuminate/support: 4.*
This package is not auto-updated.
Last update: 2024-12-21 16:15:28 UTC
README
A very simple library/bundle for creating semantic markup for your feedback messages.
Using Feedback with Laravel
Install
You can install Feedback just as you would install any other Laravel package:
- Require it through Composer. Use:
composer require koalabs/feedback
- Now open
app/config/app.php
and add this new item to yourproviders
array:
Koalabs\Feedback\FeedbackServiceProvider
- Now in the same configuration file add a new item to your aliases array:
'Feedback' => 'Koalabs\Feedback\Facades\Feedback'
That's it.
Usage
You have three basic methods for creating feedback messages:
Feedback::message($text)
, which creates a neutral message.Feedback::error($text)
, which creates an error message.Feedback::success($text)
, which creates a success message.Feedback::update($text)
, which creates an update message.Feedback::field_error($text)
, which creates an inline feedback message. It's good for form validation
Feedback::message($text)
Will output this markup:
<div class="feedback"> <p class="feedback__text">Your text here</p> </div>
Feedback::error($text)
Will output this:
<div class="feedback feedback--error"> <p class="feedback__text">Your text here</p> </div>
Feedback::success($text)
Will output this:
<div class="feedback feedback--success"> <p class="feedback__text">Your text here</p> </div>
Styling the feedback messages
You can style the feedback messages any way you want by using the classes.