- 1 Introduction
- 2 Extension Mechanism
- 2.1 Introduction
- 2.2 Add a Module
- 2.3 Extend control
- 2.4 Extend model
- 2.5 Extend view
- 2.6 Extend style sheet and JS
- 2.7 Extend language and configuration
- 2.8 Add Class Library
- 3 API Mechanism
- 4 Command Line
Extend language and configuration
- 2018-07-16 10:05:30
- tengfei
- 9029
- Last edited by tengfei on 2019-01-08 09:45:59
1. Language extension
ZenTaoPHP has abstracted all prompts on a page into language configurations, and they can be used to customized the program by redefining the language.
The language files are stored under the ext/lang/ directory. Create the corresponding directory for different languages. zentaoPHP automatically loads all the files that end with.Php in the directory.
For example, the language files of the bug module. You can create module/bug/ext/lang/zh-cn/1.php for it.
2. Configuration extension
2.1 Config extension for modules
The extension files for the configuration file of each module are stored under the ext/config/ , and zentaoPHP automatically loads the .php files whose name begin with config under this directory. So different extensions can have their own configuration items, and they will not conflict with each other.
2.2 Global config extension
The global configuration file is stored under the module/config. If the global configuration is extended, the extension files can be stored under the module/config/ext/ directory.