繁体   English   中英

在joomla中安装组件时显示表格

[英]Show form when install component in joomla

我想在安装组件时显示一个带有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 here或显示表格,它将无法正常工作并安装组件。 我怎样才能做到这一点?

看到图片,我希望它像这样: 在此处输入图片说明

我认为在joomla笔记下方对您有帮助

这是整个script.php文件

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM