【问题标题】:Joomla 3 component xml install a folder into the rootJoomla 3组件xml将文件夹安装到根目录
【发布时间】:2013-09-19 00:51:55
【问题描述】:

我正在创建一个 Joomla 3.1.x 组件。

在组件 XML 中,我有:

<files folder="site">

<files folder="administrator">

我想安装另一个必须进入 Joomla 根目录的文件夹。

这个xml怎么办?

【问题讨论】:

    标签: xml joomla components directory joomla3.0


    【解决方案1】:

    您需要使用 script.php 文件。

    首先,将以下内容添加到您的 xml 文件中:

    <scriptfile>script.php</scriptfile>
    

    然后将其添加到您的 script.php 中:

    class com_componentnameInstallerScript
    {
          public function install();
              $path = JPATH_SITE . "/folder_name";
              JFolder::create($path, 0755)
          }     
    }
    

    别忘了更改com_componentnamefolder_name

    希望对你有帮助

    【讨论】:

      【解决方案2】:

      您需要创建一个安装程序脚本文件来覆盖清单中正常安装程序流程中的目录创建。见Joomla documentation here

      【讨论】:

        【解决方案3】:

        尝试使用文件标签而不是文件夹标签。您可以将文件放在任何地方。 您还可以使用文件适配器打包单个文件。

        【讨论】:

          猜你喜欢
          • 2012-05-11
          • 2011-07-06
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2011-09-17
          • 1970-01-01
          • 2021-01-17
          • 2013-08-17
          相关资源
          最近更新 更多