loonies / kohana-notice Goto Github PK
View Code? Open in Web Editor NEWSimple and easy to use class for displaying notification messages to the user
License: MIT License
Simple and easy to use class for displaying notification messages to the user
License: MIT License
Hi, thanks for this simple little module. it's very useful.
I would like to request to add array as message parameter in add function so you can pass array in message parameter.
This is useful when we want to render error from validation class (which resulting array)
for example
Notice::add(Notice::ERROR, $validate->errors('items'));
so the code need to updated to something like this
/**
* Adds new notification message
*
* @param string Message type
* @param mixed Message text or array of Message text
* @param array Message variables
* @param array Additional message items
* @return void
*/
public static function add($type, $message = NULL, array $variables = NULL, array $items = array())
{
$session = Session::instance('native');
$notifications = $session->get('notice', array());
if (Arr::is_array($message))
{
foreach ($message as $value)
{
$notifications[$type][] = array(
'message' => __($value, $variables),
'items' => $items,
);
}
}
else
{
$notifications[$type][] = array(
'message' => __($message, $variables),
'items' => $items,
);
}
$session->set('notice', $notifications);
}
Thank you
In Notice Core, the session driver is forced to native.
This need to be changed to
$session = Session::instance();
The reason
Why in earth render would return an array instead rendering the page.
Note: version 0.3 (3.2 branch)
I think version 0.2 does a great job
Need 3.2 compatible version :D
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.