【问题标题】:How to add HTML select list to MediaWiki ContactPage?如何将 HTML 选择列表添加到 MediaWiki ContactPage?
【发布时间】:2020-02-07 03:09:34
【问题描述】:

我希望通过添加一个 HTML 选择列表来轻微更改以下默认 PHP 配置的 HTML 输出,即 MediaWiki 扩展 ContactPage

这是我的LocalSettings.php 文件中可用的整个默认 PHP 配置:

wfLoadExtension( 'ContactPage' );
$wgContactConfig['default'] = array(
    'RecipientUser' => 'WikiUser', // Must be the name of a valid account which also has a verified e-mail-address added to it.
    'SenderName' => 'Contact Form on ' . $wgSitename, // "Contact Form on" needs to be translated
    'SenderEmail' => null, // Defaults to $wgPasswordSender, may be changed as required
    'RequireDetails' => true, // Either "true" or "false" as required
    'IncludeIP' => false, // Either "true" or "false" as required
    'MustBeLoggedIn' => true, // Check if the user is logged in before rendering the form
    'AdditionalFields' => array(
        'Text' => array(
            'label-message' => 'emailmessage',
            'type' => 'textarea',
            'rows' => 20,
            'required' => true,  // Either "true" or "false" as required
        ),
    ),
        // Added in MW 1.26
    'DisplayFormat' => 'table',  // See HTMLForm documentation for available values.
    'RLModules' => array(),  // Resource loader modules to add to the form display page.
    'RLStyleModules' => array(),  // Resource loader CSS modules to add to the form display page.
);

我已阅读扩展程序的 README file,但我不清楚如何在代码中添加如下所示的 HTML 选择列表:

<select name="fruit">
    <option value ="none">Nothing</option>
    <option value ="guava">Guava</option>
    <option value ="lychee">Lychee</option>
    <option value ="papaya">Papaya</option>
</select> 

作为一名非 PHP 程序员,我问,如何在 PHP 中包含这样一个 HTML 选择列表?

【问题讨论】:

    标签: php html output mediawiki contact-form


    【解决方案1】:

    ContactForm 扩展基于 MediaWikis HTMLForm 系统。
    如何使用此系统添加不同类型的字段的示例,可以在 mediawiki.org 上的 HTMLForm 教程中找到:https://www.mediawiki.org/wiki/HTMLForm

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-02-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多