摘要:本文主要向大家介绍了Flash基础入门之Laravel-Flash,通过具体的内容向大家展现,希望对大家学习Flash基础入门有所帮助。
本文主要向大家介绍了Flash基础入门之Laravel-Flash,通过具体的内容向大家展现,希望对大家学习Flash基础入门有所帮助。
composer安装
composer require laracasts/flash
接下来,如果使用laravel 5,则在config/app.php文件中包含服务提供者
'providers'=>[Laracasts\Flash\FlashServiceProvider::class,];
Flash消息的默认CSS类是针对Twitter引导优化的。因此,在html或布局文件中插入引导程序的CSS
<link hrel="stylesheet"href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
然后在控制器内设置你想要的效果,控制器里可以这样写
public function test()
{
flash('message')->important()->error();
return redirect('/land');
}
还有很多各种你想要不想要的样式,你可以都试试看
flash('Message')->success(): Set the flash theme to "success".
flash('Message')->error(): Set the flash theme to "danger".
flash('Message')->warning(): Set the flash theme to "warning".
flash('Message')->overlay(): Render the message as an overlay.
flash()->overlay('Modal Message', 'Modal Title'): Display a modal overlay with a title.
flash('Message')->important(): Add a close button to the flash message.
flash('Message')->error()->important(): Render a "danger" flash message that must be dismissed.
模板这样写就对了,记得一定要引入css/js样式,写上三要素,这样div就可以弹出你想要的框框
视图三要素
最后贴上Github地址 Laravel-Flash
以上就介绍了Flash的相关知识,希望对Flash有兴趣的朋友有所帮助。了解更多内容,请关注职坐标常用软件Flash频道!
您输入的评论内容中包含违禁敏感词
我知道了
请输入正确的手机号码
请输入正确的验证码
您今天的短信下发次数太多了,明天再试试吧!
我们会在第一时间安排职业规划师联系您!
您也可以联系我们的职业规划师咨询:
版权所有 职坐标-一站式IT培训就业服务领导者 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
沪公网安备 31011502005948号