承接 mnshankar/flashmessenger 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mnshankar/flashmessenger

Composer 安装命令:

composer require mnshankar/flashmessenger

包简介

Easy flash notifications for Laravel 4 and PHP-5.3

README 文档

README

Build Status

Easy Flash Messages

Installation

First, pull in the package through Composer.

"require": {
    "mnshankar/flashmessenger": "1.1"
}

And then, if using Laravel, include the service provider within app/config/app.php.

'providers' => array(
    'mnshankar\Flash\FlashServiceProvider'
);

And, for convenience, add a facade alias to this same file at the bottom:

'aliases' => array(
    'Flash' => 'mnshankar\Flash\Flash'
);

Usage

Within your controllers, before you perform a redirect...

public function store()
{
    Flash::message('Welcome Aboard!');

    return Redirect::home();
}

You may also do:

  • 'Flash::info('Message')`
  • Flash::success('Message')
  • Flash::error('Message')
  • Flash::warning('Message')
  • Flash::overlay('Modal Message', 'Modal Title')

Again, if using Laravel, this will set three keys in the session:

  • 'flash_notification.message' - The message you're flashing
  • 'flash_notification.level' - A string that represents the type of notification (good for applying HTML class names)

With this message flashed to the session, you may now display it in your view(s). Maybe something like:

@if (Session::has('flash_notification.message'))
    <div class="alert alert-{{ Session::get('flash_notification.level') }}">
        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>

        {{ Session::get('flash_notification.message') }}
    </div>
@endif

Note that this package is optimized for use with Twitter Bootstrap.

Because flash messages and overlays are so common, if you want, you may use (or modify) the views that are included with this package. Simply append to your layout view:

@include('flashmessenger::message')

Example

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
</head>
<body>

<div class="container">
    @include('flashmessenger::message')

    <p>Welcome to my website...</p>
</div>

<script src="//code.jquery.com/jquery.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>

<!-- This is only necessary if you do Flash::overlay('...') -->
<script>
    $('#flash-overlay-modal').modal();
</script>

</body>
</html>

If you need to modify the flash message partials, you can run:

php artisan view:publish mnshankar/flashmessenger

The two package views will now be located in the `app/views/packages/mnshankar/flashmessenger/' directory.

Credits

This is almost a verbatim copy of Jeffrey Way's Flash library (https://github.com/laracasts/flash) .. I just tweaked it (very slightly) so I can use it with php 5.3.

mnshankar/flashmessenger 适用场景与选型建议

mnshankar/flashmessenger 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 112 次下载、GitHub Stars 达 0, 最近一次更新时间为 2015 年 02 月 25 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 mnshankar/flashmessenger 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 mnshankar/flashmessenger 我们能提供哪些服务?
定制开发 / 二次开发

基于 mnshankar/flashmessenger 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 112
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 18
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-02-25