2013-02-11 42 views
1

我認爲問題出在我的xml上。如何爲我的joomla插件創建一個簡單的管理面板

<?xml version="1.0" encoding="UTF-8"?> 
<extension version="2.5" type="plugin" group="content"> 
    <install> 
    <name>Content - eya</name> 
    <author>eya</author> 
    <creationDate>February 2013</creationDate> 
    <copyright>(C) 2013 Open Source Matters. All rights reserved.</copyright> 
    <license>GNU General Public License version 2 or later; see LICENSE.txt</license> 
    <authorEmail>[email protected]</authorEmail> 
    <authorUrl>www.eya.com</authorUrl> 
    <version>2.5.0</version> 
    <description>Adds eya plugin ot your site</description> 
    <files> 
    <filename plugin="eya">eya.php</filename> 
    </files> 
    </install> 

    <administration > 
     <filename>admin.php</filename> 
    </administration> 
</extension> 

這是我執行內容的主要php文件:eya.php。

我有另一個文件(admin.php),它需要2個來自eya.php的會話變量,並將它們放在iframe中。有兩個問題。一個是我不知道eya.php是否在admin.php之前每次運行(或者至少一次設置會話變量)。第二個問題是,我不知道如何顯示只有admin.php,沒有別的。

回答

0

建立你的插件管理界面只在配置部分添加到您的XML

<config> 
    <fields name="params"> 
     <fieldset name="basic"> 
      <field name="testfield" type="text" default="mytest" label="field_label" description="field_description" /> 
     </fieldset> 
    </fields> 
</config> 

,但我沒有得到你的admin.php的部分/ eya.php

+0

但我需要將admin.php的內容放入inisde中。我怎麼做? – BlackFire27 2013-02-11 15:06:31

+0

'$ params-> get(param_name)'是用來從參數中獲取數據的。 另外,從您的XML文件 – Lodder 2013-02-11 15:15:40

+0

中刪除您的''標籤,但我的插件中沒有參數。什麼刪除安裝標籤有什麼事情要做 – BlackFire27 2013-02-11 15:48:50

相關問題