vitd/contentwidget

Magento 2.x 小部件,用于包含文件或URL作为内容。可以在XML或页面中调用

安装: 60

依赖项: 0

建议者: 0

安全: 0

类型:magento2-module

1.4.0 2018-06-19 15:29 UTC

This package is auto-updated.

Last update: 2024-09-23 04:07:06 UTC


README

参数

类型参数描述
stringvitd_type'url' 或 'file'。
stringvitd_url此值将用于URL或文件。
selectvitd_force_include0 或 1。文件将使用 include() 包含,否则将使用 file_get_contents()
selectvitd_force_reload0 或 1。这将向URL添加时间戳。
selectvitd_container'', 'div' 或 'iframe'。内容可以有 'div' 或 'iframe' 的闭包。
numbervitd_iframe_width定义IFRAME的宽度。
numbervitd_iframe_height定义IFRAME的高度。
selectvitd_string_conversion'' => 不转换,'utf8' => 转换为UTF-8,'win1252' => 转换为Win1252 / Latin1 / ISO-8859,'fix' => 修正UTF-8或'fix1252' => 修正UTF-8与混合Win1252。
selectvitd_nlbr0 或 1。这将把所有换行符替换为 <br/>
selectvitd_escape_content0 或 1。这将使用 htmlentities($content, ENT_QUOTES | ENT_SUBSTITUTE) 对内容进行转义
numbervitd_timeout默认为 10
selectvitd_http_method'GET' 或 'POST' 默认为 GET
selectvitd_use_hoststable0 或 1。使用商店配置中的前缀URL和主机表配置

用法

XML中的示例用法

<block class="Vitd\ContentWidget\Block\Widget\Content">
    <arguments>
        <argument name="vitd_type" xsi:type="string">url</argument>
        <argument name="vitd_url" xsi:type="string">/customContent.php</argument>
    </arguments>
</block>

页面中的示例用法

// Minimlistic usage (defautl is type 'url'
{{widget type="Vitd\\ContentWidget\\Block\\Widget\\Content" vitd_url="/customContent.php"}}

版本说明

v1.4.0 (2018-06-19)

  • 新增:后端配置以禁用小部件的输出,并显示URL或文件名

v1.3.0 (2018-06-05)

  • 新增:小部件的商店配置路径 -> /stores/configuration/vitamin d/content widget
  • 新增参数: vitd_use_hoststable

v1.2.2 (2018-03-06)

  • 错误:构建URL没有接受绝对路径。

v1.2.0 (2018-03-03)

  • 新增参数 vitd_timeout
  • 新增参数 vitd_http_method
  • 捕获 file_get_contentsscripts 的异常。内容将替换为消息,如果客户端中断,则仅清除内容。
  • 常量已移动到 ContentWidgetConstInterface,此文件现在包含所有预定义的默认值(有关更多信息请参阅此类)
  • 代码优化