模块
v1.0.0
2023-10-31 18:26 UTC
Requires
- php: >=7 || ~8
- liberty_code/cache: ^1.0.
- liberty_code/command: ^1.0.
- liberty_code/controller: ^1.0.
- liberty_code/data: ^1.0.
- liberty_code/di: ^1.0.
- liberty_code/file: ^1.0.
- liberty_code/framework: ^1.0.
- liberty_code/library: ^1.0.
- liberty_code/request_flow: ^1.0.
- liberty_code/view: ^1.0.
This package is auto-updated.
Last update: 2024-09-30 01:28:49 UTC
README
描述
库包含框架模块,用于管理应用程序渲染。
要求
- 脚本语言:PHP:版本 7 或 8
安装
有几种可能的方式
Composer
要求
需要安装Composer。更多信息:https://getcomposer.org
命令:在项目根路径下移动
cd "<project_root_path>"
命令:安装
php composer.phar require liberty_code_module/view ["<version>"]
注意
包含vendor
如果项目使用Composer,必须包含vendor
require_once('<project_root_path>/vendor/autoload.php');
配置
安装命令允许在composer文件中添加
{ "require": { "liberty_code_module/view": "<version>" } }
包含
下载
- 下载以下存储库。
- 将其放在存储库根路径上。
包含源代码
require_once('<repository_root_path>/include/Include.php');
应用程序安装
配置
配置:应用程序模块:"
在列表部分添加,所需的模块
YML配置格式示例,来自composer安装
list: [ { path: "/vendor/liberty_code_module/view/src/view", config_parser: { type: "string_table_php", source_format_get_regexp: "#^\\<\\?php\\s*(.*)(\\s\\?\\>)?\\s*$#ms", source_format_set_pattern: "<?php \\n%1$s", cache_parser_require: true, cache_file_parser_require: true } }, { path: "/vendor/liberty_code_module/view/src/php_compiler", config_parser: { type: "string_table_php", source_format_get_regexp: "#^\\<\\?php\\s*(.*)(\\s\\?\\>)?\\s*$#ms", source_format_set_pattern: "<?php \\n%1$s", cache_parser_require: true, cache_file_parser_require: true } }, { path: "/vendor/liberty_code_module/view/src/cache", config_parser: { type: "string_table_php", source_format_get_regexp: "#^\\<\\?php\\s*(.*)(\\s\\?\\>)?\\s*$#ms", source_format_set_pattern: "<?php \\n%1$s", cache_parser_require: true, cache_file_parser_require: true } } ]
配置
应用程序参数配置
在您的模块中使用以下文件来配置特定元素
<module_root_path>/config/ParamApp.php
可配置元素
配置到模板参数存储库。
配置到编译器。
配置到填充查看器附加参数。
配置到查看器。
配置到缓存。
用法
以下示例假设命令行应用程序相对路径为"bin/app"。
视图
功能允许设置和管理在应用程序中可用的渲染。
PHP编译器
功能允许设置和管理应用程序渲染可用的PHP编译器。
缓存
功能允许设置和管理在应用程序渲染可用的缓存。
示例
cd "<project_root_path>"
...
// Remove all items, from view cache
php bin/app view:cache:remove