我有一个joomla3网站,我建立了一个外部的html页面,这是一个客户端的应用程序(Jquery),只有登录的用户可见。该页面位于The服务器根目录下的目录中。
我会在这个html页面的顶部显示当前用户的数据。这有可能吗?
在我的情况下,我没有发现任何有用的东西。似乎joomla3中不存在JFactory。
谢谢
发布于 2013-05-16 21:07:41
您需要初始化整个框架才能访问它的各个部分。以主index.php为例,了解如何做到这一点。而不是路由和分派,把你的代码放在那里。
standalone-script.php
<?php
/**
* Constant that is checked in included files to prevent direct access.
*/
define('_JEXEC', 1);
if (file_exists(__DIR__ . '/defines.php'))
{
include_once __DIR__ . '/defines.php';
}
if (!defined('_JDEFINES'))
{
define('JPATH_BASE', __DIR__);
require_once JPATH_BASE . '/includes/defines.php';
}
require_once JPATH_BASE . '/includes/framework.php';
// Instantiate the application.
$app = JFactory::getApplication('site');
// Initialise the application.
$app->initialise();
// Your code goes here...发布于 2013-05-16 08:55:27
据我所知是存在的https://github.com/joomla/joomla-cms/blob/master/libraries/joomla/factory.php
看看error php,它可能会帮助你了解如何创建一个独立的页面。但是请注意,哈,你需要从一个独立的应用程序中给出平台,你需要确保你指向正确的文件夹。
https://stackoverflow.com/questions/16569277
复制相似问题