solve-x/view-model
Composer 安装命令:
composer require solve-x/view-model
包简介
A more structured way of processing requests (inspired by ASP.NET)
关键字:
README 文档
README
Model validation in ASP.NET Core MVC
Note: this library is still in beta. We might make incompatible changes until version 1.
A short example:
<?php namespace App\ViewModels; use SolveX\ViewModel\ViewModel; class RegistrationViewModel extends ViewModel { /** * @var string */ public $FirstName; /** * @var int */ public $Age; }
<?php namespace App\Controllers; use App\ViewModels\RegistrationViewModel; class UserController { public function register(RegistrationViewModel $model) { // At this point $model is ready to use. // In case binding or validation fails, an exception is thrown during model construction. // $model->FirstName // $model->Age } }
Laravel integration
统计信息
- 总下载量: 466
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-09-06