industrious/wp-helpers
最新稳定版本:v1.0
Composer 安装命令:
composer require industrious/wp-helpers
包简介
A WP Helpers package.
关键字:
README 文档
README
Introduction
industrious/wp-helpers is a [[]].
License
industrious/wp-helpers is open-sourced software licensed under the MIT license
Installation
To get started with industrious/wp-helpers, use Composer to add the package to your project's dependencies:
composer require industrious-mouse/wp-helpers
Examples
Validation Helpers
Below is an example of how you might be able to use the ValidatesRequests trait, to validate a form.
use ValidatesRequests;
/**
*
*/
public function __construct()
{
$data = [
'abc' => '123',
'def' => '123',
];
$rules = [
'abc' => 'required',
'def' => 'required',
];
$errors = $this->validate($data, $rules);
if (! $errors) {
wp_send_json_success();
}
wp_send_json_error([
'errors' => $errors->toArray()
]);
}
统计信息
- 总下载量: 120
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-10-01