我只是按照这个视频创建了一个组件。我创建了名为 admin.zip 的组件。在 joomla 3.0 中安装时,我收到以下警告。
警告
JInstaller: :Install: 文件不存在 C:\wamp\www\Content\tmp\install_52009de34a2c1\site\language\en-GB.com_helloworld.ini
JInstaller: :Install: 文件不存在 C:\wamp\www\Content\tmp\install_52009de34a2c1\admin\language\en-GB.com_helloworld.ini
我在组件菜单下获得 helloworld 组件。但是当我点击它时它给了我错误。它应该向我显示 Hello world,如视频所示。
我的 wamppserver 版本是 2.4 并使用 joomla 3.0。
我该如何纠正这个问题
我的 helloworld.xml 文件包含此代码
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="2.5.0" method="upgrade">
<name>com_helloworld</name>
<creationDate>November 2009</creationDate>
<author>David Thorn</author>
<authorEmail>info@thornwebdesign.org</authorEmail>
<authorUrl>http://www.example.org</authorUrl>
<copyright>Copyright Info</copyright>
<license>License Info</license>
<version>1.0.0.1</version>
<description>Description of the Hello World component ...</description>
<files folder="site">
<filename>index.html</filename>
<filename>helloworld.php</filename>
<filename>controller.php</filename>
<folder>css</folder>
<folder>js</folder>
<folder>views</folder>
<folder>models</folder>
<folder>controllers</folder>
<folder>helpers</folder>
<folder>language</folder>
</files>
<languages folder="site">
<language tag="en-GB">language/en-GB.com_helloworld.ini</language>
<language tag="en-GB">language/en-GB.com_helloworld.sys.ini</language>
</languages>
<administration>
<menu>com_helloworld</menu>
<files folder="admin">
<filename>index.html</filename>
<filename>helloworld.php</filename>
<filename>controller.php</filename>
<folder>css</folder>
<folder>js</folder>
<folder>views</folder>
<folder>models</folder>
<folder>controllers</folder>
<folder>helpers</folder>
<folder>language</folder>
</files>
<languages folder="admin">
<language tag="en-GB">language/en-GB.com_helloworld.ini</language>
<language tag="en-GB">language/en-GB.com_helloworld.sys.ini</language>
</languages>
</administration>
</extension>
在我的 helloworld.php 我有这个代码
<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import joomla controller library
jimport('joomla.application.component.controller');
// Get an instance of the controller prefixed by HelloWorld
$controller = JController::getInstance('Helloworld');
// Perform the Request task
$input = JFactory::getApplication()->input;
$controller->execute($input->getCmd('task'));
// Redirect if set by the controller
$controller->redirect();
?>
更新
我在 joomla 2.5 中成功地做到了这一点,但它在最新版本的 joomla 中不起作用。我应该怎么做才能让它在 joomla 3.0 中工作