定制 nsbucky/input 二次开发

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

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

nsbucky/input

Composer 安装命令:

composer require nsbucky/input

包简介

A simple input class

README 文档

README

Lightweight utility package to deal with request input variables. Probably dead

PHP 5.4 + only.

Usage

$input = new \Input\Post(); // Get/Server/Cookie/Env or Your Array using \Input\Container( array );

$value = $input->value('my_post_val', 'default_value');

$bool = $input->has('var1');

$all = $input->all();

$except = $input->except('var1','var2','var3');

$only = $input->only('var1');

Sanitize

$int   = $input->asInt('var1');
$email = $input->asEmail('email_variable');

Validate

$bool = $input->isEmail('email_variable');
$bool = $input->isAlpha('alpha_var');
$bool = $input->notAlpha('number_var');

Files

$files = new \Input\Files();

// get single file
// returns instance of \SplFileInfo
$file = $files->get('filename');

// returns instance of new moved file
$uploadedFile = $file->move('/path/to/dir');

// can rename files
$file->setName('newname');
$uploadedFile = $file->move('/path/to/dir'); // will be named to 'newname'

// can validate the files
$bool = $file->hasExtension('pdf');
$bool = $file->hasExtension(['jpg','png','gif']);
$bool = $file->hasMimeType('pdf');
$bool = $file->hasMimeType(['image/jpeg','image/png']);
$bool = $file->notBiggerThan('1M'); // in bytes or k/m/g/t

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-05-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固