php代码
public function getIndex()
{
$rules = array(
'email' => 'required|email',
'name' => 'required|between:1,20',
'password' => 'required|min:8',
);
$message = array(
"required" => ":attribute 不能为空",
"between" => ":attribute 长度必须在 :min 和 :max 之间"
);
$attributes = array(
"email" => '电子邮件',
'name' => '用户名',
'password' => '用户密码',
);
$validator = Validator::make(
Input::all(),
$rules,
$message,
$attributes
);
if ($validator->fails()) {
$warnings = $validator->messages();
$show_warning = $warnings->first();
return Response::Json(compact('show_warning'));
}
return Response::Json("ok");
}
@if($errors->any())@foreach($errors->all() as $error){{ $error }}@endforeach@endif
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号