【问题标题】:Show form when install component in joomla在 joomla 中安装组件时显示表单
【发布时间】:2023-04-08 21:14:01
【问题描述】:

我想在安装组件时显示一个带有 JavaScript 的小表单,就像我们安装组件时一样,然后在安装后我只想显示一个表单。我创建了一个 script.commercial.php 文件并将此文件添加到组件 xml 中,请参见下面的代码:

commercial.xml 文件

<scriptfile>script.commercial.php</scriptfile>
<installfile>script.commercial.php</installfile>

script.commercial.php

    <?php
defined ('_JEXEC') or die('Restricted access');
defined ('DS') or define('DS', DIRECTORY_SEPARATOR);

function install () {
    $this->cmInstall();
}

function cmInstall()
{
    echo 'Show Form here.';
    echo '<span class="installScript" id="installScript"> Click Here..!! </span>';
}

$document = JFactory::getDocument();
$document->addScript(JURI::BASE().'components/com_commercial/commercial.js');

但是如果没有在此处显示Click 或显示表单,它就无法正常工作和组件安装。我该怎么做?

看图片,我希望它是这样的:

【问题讨论】:

    标签: php joomla installation components joomla3.0


    【解决方案1】:

    我认为下面的 joomla 笔记对你有帮助

    This is the entire script.php file

    【讨论】:

    • 那是 joomla 2.5 的,检查你提到的 url 和标签
    • 虽然此链接可能会回答问题,但最好在此处包含答案的基本部分并提供链接以供参考。如果链接页面发生更改,仅链接的答案可能会失效
    • 谢谢。 Joomla2.5 与 Joomla3.x 相同docs.joomla.org/J3.x:Developing_a_MVC_Component/…
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-11
    • 2011-03-06
    • 2011-01-04
    • 1970-01-01
    • 1970-01-01
    • 2019-04-13
    相关资源
    最近更新 更多