0
我为Joomla 2.5编写了一个组件,它在管理部分使用jquery。 js脚本调用一个辅助php文件(addrow.php),该文件使用Joomla的表单域返回一个表格的新行。由于该文件是Joomla的框架我用这些线,使外它的工作:从外部php-script访问Joomla
define('_JEXEC', 1);
define('JPATH_BASE', realpath(dirname(__FILE__).'/../..'));
require_once(JPATH_BASE.'includes/defines.php');
require_once(JPATH_BASE.'includes/framework.php');
require_once(JPATH_BASE.'libraries/joomla/factory.php');
升级到Joomla 3.2之后,并没有工作了,我刚收到
错误显示错误页面:应用程序实例化错误
,但通过添加
$mainframe = JFactory::getApplication('site');
$mainframe->initialise();
它再次运作。
我的问题是,如果这是一般正确的方式来编写jQuery的外部PHP脚本?
即使是管理员,getApplication('site')是否正确?
作品。完美 – josh21