bpocallaghan/alert
最新稳定版本:1.2.3
Composer 安装命令:
composer require bpocallaghan/alert
包简介
A helper package to flash a bootstrap alert to the browser.
README 文档
README
A helper package to flash a bootstrap alert to the browser via a Facade or a helper function.
<div class="alert alert-info fade in"> <i class="fa-fw fa fa-smile-o"></i> <strong>Title</strong> Description </div>
###Want to see the current package in action, have a look at my starter project. ###Laravel Starter Project
Installation
First, pull in the package through Composer.
"require": { "bpocallaghan/alert": "1.*" }
OR
composer require bpocallaghan/alert
Usage
Within any view file.
@include('alert::alert')
Within any Controller.
public function index() { // helper function - default to the 'info' alert('Title', 'Lorem Ipsum'); // return object first alert()->info('Title', 'Lorem Ipsum'); // via the facade Alert::info('Title', 'Lorem Ipsum'); return view('home'); }
The different 'levels' are:
alert()->info('Title', 'Lorem Ipsum');alert()->success('Title', 'Lorem Ipsum');alert()->warning('Title', 'Lorem Ipsum');alert()->danger('Title', 'Lorem Ipsum');
The different arguments:
alert()->info('Title', 'Lorem Ipsum', false);// without the iconalert()->info('Title', 'Lorem Ipsum', 'smile-o');// specify the icon classalert()->info('Title', 'Lorem Ipsum', 'smile-o', true);// limit alert to the request lifecyclealert()->message('Title', 'Lorem Ipsum', 'smile-o', true, 'info');// specify the type of levelalert()->message('Title', 'Lorem Ipsum', 'smile-o', true, 'info', false);// do not show the 'close'
If you need to modify the view partial, you can run:
php artisan vendor:publish --provider="Bpocallaghan\Alert\AlertServiceProvider"
The view partial can be found here resources\views\vendor\alert\alert.blade.
My other Packages
统计信息
- 总下载量: 18.14k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 19
- 点击次数: 1
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-04-01