Quantcast
Channel: Joomla! Forum - community, help and support
Viewing all articles
Browse latest Browse all 1409

Joomla! 5.x Coding • Error access joomla 5 framework from external php file

$
0
0
Hi

Code:

error_reporting(E_ALL);ini_set('display_errors', 1);use Joomla\CMS\Factory;use Joomla\CMS\HTML\HTMLHelper;use Joomla\CMS\Language\Text;use Joomla\CMS\Uri\Uri;use Joomla\CMS\Language\LanguageFactoryInterface;use Joomla\CMS\Plugin\PluginHelper;use Joomla\CMS\Helper\ModuleHelper;use Joomla\Utilities\ArrayHelper;define('_JEXEC', 1);define('JPATH_BASE',$_SERVER['DOCUMENT_ROOT']);require_once JPATH_BASE . '/includes/defines.php';require_once JPATH_BASE . '/includes/framework.php';$container = \Joomla\CMS\Factory::getContainer();$container->alias('session.web', 'session.web.site')->alias('session', 'session.web.site')->alias('JSession', 'session.web.site')->alias(\Joomla\CMS\Session\Session::class, 'session.web.site')->alias(\Joomla\Session\Session::class, 'session.web.site')->alias(\Joomla\Session\SessionInterface::class, 'session.web.site');$app = $container->get(\Joomla\CMS\Application\SiteApplication::class);\Joomla\CMS\Factory::$application = $app;$app->createExtensionNamespaceMap();$lang = $container->get(LanguageFactoryInterface::class)->createLanguage("ru-RU", false);$app->loadLanguage($lang);$module = ModuleHelper::getModules('slide_mobile');
Error: Call to a member function getAuthorisedViewLevels() on null
Image
I do not know how to solve this problem. I'm asking for help.

Statistics: Posted by eLig — Sun Aug 25, 2024 6:49 pm



Viewing all articles
Browse latest Browse all 1409

Trending Articles