承接 webiik/flash 相关项目开发

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

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

webiik/flash

Composer 安装命令:

composer require webiik/flash

包简介

The Flash provides multilingual flash notifications.

README 文档

README

Flash

The Flash provides multilingual flash notifications.

Installation

composer require webiik/flash

Example

$flash = new \Webiik\Flash\Flash($session);
$flash->addFlashCurrent('inf', 'Hello {name}', ['name' => 'Dolly']);
$flash->addFlashNext('inf', 'Hello {name}', ['name' => 'Molly']);
print_r($flash->getFlashes()); // Array ([inf] => Array ([0] => Hello Dolly ))

Next request:

$flash = new \Webiik\Flash\Flash($session);
print_r($flash->getFlashes()); // Array ([inf] => Array ([0] => Hello Molly ))

Configuration

setLang

setLang(string $lang): void

setLang() sets current language of flash messages. The default value is en.

$flash->setLang('en');

Adding

addFlashCurrent

addFlashCurrent(string $type, string $message, array $context = []): void

addFlashCurrent() adds flash message in current language to be displayed in current request. $type represents custom type of message e.g. inf, err, ok. The message may contain {placeholders} which will be replaced with values from the $context array.

$flash->addFlashCurrent('inf', 'Hello {name}', ['name' => 'Dolly']);

addFlashNext

addFlashNext(string $type, string $message, array $context = []): void

addFlashNext() adds flash message in current language to be displayed in next request. $type represents custom type of message e.g. inf, err, ok. The message may contain {placeholders} which will be replaced with values from the $context array.

$flash->addFlashNext('inf', 'Hello {name}', ['name' => 'Molly']);

Getting

getFlashes

getFlashes(): array

getFlashes() returns array of all messages to be displayed in current request and language.

$flashMessages = $flash->getFlashes();

Resources

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-03-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固