Download the PHP package moyer/qtemp without Composer
On this page you can find all versions of the php package moyer/qtemp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package qtemp
qtemp 集成式工具包
qtemp 是一个为 ThinkCMF 框架设计的集成式工具包,提供了丰富的 UI 控件、表单组件和 Excel 处理功能,帮助开发者快速构建后台管理界面。
总的说,我还想做一个无手动编码的后台系统,但一个足够集成化的模板库是前置条件。
安装
Composer 安装(推荐)
版本要求
- PHP >= 8.0
- ThinkCMF >= 8.0
目录结构
核心特性
1. 魔术方法调用
qtemp 基类提供了灵活的魔术方法调用方式:
- 属性设置:
$obj->propertyName($value)- 设置属性值 - 布尔属性:
$obj->propertyName()- 将布尔属性设为true - 布尔否定:
$obj->noPropertyName()- 将布尔属性设为false - 数组添加:
$obj->addPropertyName($array)- 为数组属性添加元素
2. 链式调用
所有 setter 方法都支持链式调用,使代码更加简洁:
3. 助手函数
通过 composer 自动加载的全局助手函数:
快速开始
按钮控件
表单控件
导航标签 + 表格
Excel 导出
文件上传
API 参考
Qtemp 基类方法
所有继承 Qtemp 的类都支持以下魔术方法:
| 方法模式 | 说明 | 示例 |
|---|---|---|
addXxx(array) |
为数组属性添加元素 | addParam(['key' => 'value']) |
xxx() |
将布尔属性设为 true | required() |
noXxx() |
将布尔属性设为 false | noDisabled() |
xxx(mixed) |
设置属性值 | name('username') |
Control 控件基类
| 方法 | 说明 |
|---|---|
htmlclass(string\|array) |
设置样式类(覆盖) |
addHtmlclass(string\|array) |
添加样式类(追加) |
config(array) |
设置配置 |
addConfig(array) |
添加配置 |
data(array) |
设置 data 属性 |
addData(array) |
添加 data 属性 |
echo() |
输出控件 |
str() |
获取控件字符串 |
FormControl 表单基类
| 方法 | 说明 |
|---|---|
name(string) |
设置字段名 |
title(string) |
设置标题 |
value(mixed) |
设置值 |
required(bool) |
设置是否必填 |
disabled(bool) |
设置是否禁用 |
read_only(bool) |
设置是否只读 |
group() |
分组输出(带标签) |
groupStr() |
获取分组输出字符串 |
ExcelExport 导出类
| 方法 | 说明 |
|---|---|
column(array) |
设置列配置 |
addColumn(array) |
添加列配置 |
data(array) |
设置数据 |
addData(array) |
添加数据 |
name(string) |
设置导出文件名 |
limit(int) |
设置数据量限制 |
export() |
执行导出下载 |
信息
- 作者: 莫耶尔
- Packagist: moyer/qtemp
- GitHub: Orcreala/qtemp
开源协议
MIT License
All versions of qtemp with dependencies
PHP Build Version
Package Version
The package moyer/qtemp contains the following files
Loading the files please wait ...