簡體   English   中英

在外部HTML頁面中獲取Joomla3用戶數據

[英]Get Joomla3 user data in external html page

我有一個joomla3網站,我建立了一個外部html頁面,它是一個客戶端應用程序(jquery),僅對登錄用戶可見。 該頁面位於Web服務器根目錄中的目錄中。

我將在此html頁面的頂部擁有當前用戶的數據。 那可能嗎?

在我的情況下,我沒有發現任何有效的方法。 看來jFactory在joomla3中不存在。

謝謝

據我所知存在https://github.com/joomla/joomla-cms/blob/master/libraries/joomla/factory.php

看一下錯誤php,它可以幫助您了解如何制作一個獨立的頁面。 但是請注意,如果您需要從獨立應用程序提供平台,則需要確保指向正確的文件夾。

您需要初始化整個框架才能訪問其各個部分。 以main 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...

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM