Home > Backend Development > PHP Tutorial > How to display the Chinese name of the field in laravel form error message?

How to display the Chinese name of the field in laravel form error message?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-08-04 09:20:32
Original
1504 people have browsed it

How to display the Chinese name of the field in laravel form error message?

nickname is so unfriendly
This tutorial teaches you how to write it
How to display the Chinese name of the field in laravel form error message?

Reply content:

How to display the Chinese name of the field in laravel form error message?

nickname is so unfriendly
This tutorial teaches you how to write it
How to display the Chinese name of the field in laravel form error message?

Then write them separately

<code>'start.required'=>'请填写开始时间',
'type.required'=>'请填写数据的分类',</code>
Copy after login

Three methods:
1. Use trans() to write, write the Chinese name of the field to /resources/lang/zh-CN/auth.php, and then use it, refer to Laravel 5.2 documentation - Localization :
2. Add the Chinese name to the data table related fields in the data table migration file: ->comment('Chinese name');, refer to Laravel 5.2 document - Migration (but how to get the value of comment, I I haven’t seen it in the document yet)
3.The last method is to install the laravel-lang expansion package, it comes with Chinese form verification prompts, highly recommended! Remember to change locale to "zh-CN" in config/app.php.
How to display the Chinese name of the field in laravel form error message?

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template