mediawiki/aform
Composer 安装命令:
composer require mediawiki/aform
包简介
Convenient parser function for setting up form markup in MediaWiki
关键字:
README 文档
README
MediaWiki parser hook extension that provides parser functions for generating HTML form markup.
Installation
- Copy the extension directory to
extensions/Aform/. - Add to
LocalSettings.php:wfLoadExtension( 'Aform' );
Requires PHP ≥ 7.2 and MediaWiki with wfLoadExtension support.
Parser Functions
#aform — open a form
{{#aform: action=PageName | method=get }}
| Parameter | Description |
|---|---|
action |
Wiki page name (converted to URL automatically) or absolute URL (https://, http://, ftp://) |
method |
get or post |
| common attrs | class, id, style, rel, itemprop, content, data-* |
#aformend — close the form
{{#aformend:}}
#ainput — single input field
{{#ainput: type=text | name=q | value=default | size=20 }}
| Parameter | Description |
|---|---|
type |
Input type (text, hidden, submit, checkbox, etc.) |
name |
Field name |
value |
Field value |
size |
Field width |
readonly, disabled, checked, alt |
Standard HTML attributes |
| common attrs | class, id, style, rel, itemprop, content, data-* |
#ainput_multi — multiple hidden inputs from a list
{{#ainput_multi: type=hidden | list=field1=value1&field2=value2 }}
The list parameter is an &-separated list of name=value pairs. Each pair generates one <input> element. Other attributes (type, size, readonly, disabled, checked, alt, common attrs) are applied to all generated inputs.
#aselect — select dropdown
{{#aselect: name=animal | values=Dog,Cat,Mouse | selected=Dog }}
| Parameter | Description |
|---|---|
name |
Field name (use name=field[] for multi-select) |
values |
Comma-separated option values |
names |
Comma-separated display labels (parallel to values; defaults to value if omitted) |
selected |
Comma-separated values to pre-select |
sep |
Custom separator character instead of , |
size |
Visible row count |
multiple |
Set to multiple to allow multiple selections |
| common attrs | class, id, style, rel, itemprop, content, data-* |
#alabel — label element
{{#alabel: My Label | for=fieldid | class=form-label }}
The first positional argument is the label text. Supports common attrs (class, id, style, rel, itemprop, content, data-*).
Example
{{#aform: action={{FULLPAGENAME}} | method=get }}
{{#alabel: Animal | for=animal-select }}
{{#aselect: name=animal[] | multiple=multiple | values=Dog,Cat,Mouse | selected=Dog }}
{{#ainput: type=text | size=4 | name=offset }}
{{#ainput_multi: type=hidden | list=text=House&size=100 }}
{{#aformend:}}
Development
composer test # lint (parallel-lint + minus-x) composer fix # fix file permissions/line endings
mediawiki/aform 适用场景与选型建议
mediawiki/aform 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 237 次下载、GitHub Stars 达 1, 最近一次更新时间为 2014 年 11 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「form」 「mediawiki」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mediawiki/aform 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mediawiki/aform 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mediawiki/aform 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Automatically logs-in users if they are already authenticated by a remote source. (e.g. environment variable REMOTE_USER)
An extension to Semantic MediaWiki allowing to build breadcrumb links from an attributive property filter
Helper functions for the MediaWiki ExtensionRegistry
Adds the EDTF data type to Wikibase
Diese Contao 4 Erweiterung stellt Google reCAPTCHA V2 in Form eines neuen Formularfeldes im Formulargenerator bereit. This extension provides Google reCAPTCHA V2 in the form of a new form field in the form generator of Contao Open Source CMS.
MediaWiki extension that allows embedding external content, specified by URL, into your wiki pages
统计信息
- 总下载量: 237
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2014-11-18