定制 pytocryto/flash 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

pytocryto/flash

Composer 安装命令:

composer require pytocryto/flash

包简介

Flash messages with PHP sessions

README 文档

README

This library is by default Bootstrap compatible but you can customize it how you want.

Installation (require composer)

With Composer

composer require pytocryto/flash

Usage example

// require the composer autoload
require __DIR__ . '/vendor/autoload.php';

if (session_status() === PHP_SESSION_NONE) {
    // start the session
    session_start();
}

// create a new FlashMessage instance
$flash = PytoCryto\Flash\FlashMessage::getInstance();

/**
 * Configuration (optional)
*/
$flash->config([
    'sticky'     => false, // sticky: Render all messages without a close button
    'fadeOut'    => true, // fadeOut on close
    'withTitles' => true, // render messages with the message type as a title if none specified
]);

/**
 * Flash messages
*/
$flash->info('Hello! This is a sticky info message with a title.', $dismissable = false, 'Title here'); // sticky message
$flash->error('Hello! This is a error message.');
$flash->success('Hello! This is a success message.');
$flash->warning('Hello! This is a warning message. Number: {counter}');
$flash->warning('Hello! This is a warning message. Number: {counter}');

// you can check if certain types of messages exist, this is useful for form validation
if ($flash->hasErrors()) {
    // error messages has been set
}
if ($flash->hasWarnings()) {
    // warning messages has been set
}

// display all messages
$flash->display();

// or just display the errors and warnings
$flash->display(['error', 'warning']);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-04-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固