Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

自定义了一个验证方法,语言包的识别ID怎么配 #8

Closed
ziqiming opened this issue Dec 21, 2023 · 3 comments
Closed

自定义了一个验证方法,语言包的识别ID怎么配 #8

ziqiming opened this issue Dec 21, 2023 · 3 comments

Comments

@ziqiming
Copy link

我知道 验证器代码解构是这样的

目录
mod\home\validater\checker.php

增加代码
public function is_date($v){
$res = preg_match('/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/', $v);
return $res ? 0 : 947;
}

947错误提示文字报错了,这个947识别文字加到哪里?

mod\home\language***.php
这个目录下方的文件和代码解构是什么?

这个怎么用呢?

@poetbi
Copy link
Owner

poetbi commented Dec 27, 2023

在语言包error.php中定义: 947 => '...'

1.默认使用/boa/language/zh-cn/error.php中定义;
2.如果在模块中定义了,系统优先使用此项,比如在/mod/home/language/zh-cn/error.php中定义了,在home模块环境中优先使用该定义,其他模块中则继续使用系统定义;

更多请参考手册总控->语言使用。

@poetbi
Copy link
Owner

poetbi commented Dec 27, 2023

一个模块初始化后生成的目录,在该模块环境下,都是可以自定义覆盖系统相对应部分,包括配置,比如通过配置在各模块中连接不同数据库,覆盖系统配置等

@poetbi
Copy link
Owner

poetbi commented Jan 9, 2024

模块下自定义错误码做了修复,请参考更新

@poetbi poetbi closed this as completed Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants