承接 hexbit/php-flash 相关项目开发

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

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

hexbit/php-flash

Composer 安装命令:

composer require hexbit/php-flash

包简介

Its a session based redirector with flash messages for php.

README 文档

README

Its a session based redirector with flash messages for php. you can set flash messages between redirects and you can get your messages only once with php $_SESSION super global array.

Installation

Use the package manager composer to install php flash.

composer require hexbit/php-flash

Usage

use Hexbit\Flash\Flash;

// first initialize it:
Flash::init();


// build a new instance of flash
$flash = new Flash();

// simple usage and redirect back!
$flash->redirectBy('contact')
        ->message('failed', 'It seems your email is not valid!')
        ->redirectBack();

// redirect to specific location
$flash->redirectBy('contact')
        ->redirectLocation("https://somewhere/")
        ->withStatus(302)
        ->message('failed', 'It seems your email is not valid!')
        ->redirect();

// redirect to specific location and then redirect again after 5 seconds!
$flash->redirectLocation("https://somwhere/")
        ->message('failed', 'It seems your email is not valid!')
        ->secondRedirect(5, "https://somewhereelse/")
        ->redirect();

Now your flash messages will be available just once (after redirection) in the superGlobal $_SESSION array.

And obviously, there will be no messages for the next times and will be cleared.

if (isset($_SESSION['failed']) {
        // show your error message for example
}

Contributing

Pull requests are always welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make %sure% to update tests as appropriate.

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-06-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固