RubyLouvre / newland

node.js 全栈式MVC framework
368 stars 90 forks source link

完成flash机制 #3

Open RubyLouvre opened 12 years ago

RubyLouvre commented 12 years ago

flash是基于session的消息传送机制,我们可以把消息放到flash中并在下一个action访问到它们。 用法

flow.flash('info', 'email sent');
flow.flash('error', 'email delivery failed');
flow.flash('info', 'email re-sent');
// => 2

flow.flash('info');
// => ['email sent', 'email re-sent']

flow.flash('info');
// => []

flow.flash();
      // => { error: ['email delivery failed'], info: [] }

详见文档