*
* @return self
*
* @since 4.0.0
*/
public function addTemplateRegistryFile(string $template, int $client): self
{
switch ($client) {
case 0:
$this->addRegistryFile('templates/' . $template . '/joomla.asset.json');
break;
$this->getDocument()->setError($error);
// Add registry file for the template asset
$wa = $this->getDocument()->getWebAssetManager()->getRegistry();
$wa->addTemplateRegistryFile($template->template, $app->getClientId());
if (!empty($template->parent)) {
$wa->addTemplateRegistryFile($template->parent, $app->getClientId());
}
'subject' => $app,
'document' => $renderer->getDocument(),
])
);
$data = $renderer->render($error);
// If nothing was rendered, just use the message from the Exception
if (empty($data)) {
$data = $error->getMessage();
}
* @since 3.10.0
*/
public static function handleException(\Throwable $error)
{
static::logException($error);
static::render($error);
}
/**
* Render the error page based on an exception.
*
);
// Trigger the onError event.
$this->dispatchEvent('onError', $event);
ExceptionHandler::handleException($event->getError());
}
// Trigger the onBeforeRespond event.
$this->dispatchEvent(
'onBeforeRespond',
// Set the application as global app
\Joomla\CMS\Factory::$application = $app;
// Execute the application.
$app->execute();
* define() is used rather than "const" to not error for PHP 5.2 and lower
*/
define('_JEXEC', 1);
// Run the application - All executable code should be triggered through this file
require_once dirname(__FILE__) . '/includes/app.php';
if (empty(self::$instances[$client])) {
// Create a Router object
$classname = 'JRouter' . ucfirst($client);
if (!class_exists($classname)) {
throw new \RuntimeException(Text::sprintf('JLIB_APPLICATION_ERROR_ROUTER_LOAD', $client), 500);
}
// Check for a possible service from the container otherwise manually instantiate the class
if (Factory::getContainer()->has($classname)) {
self::$instances[$client] = Factory::getContainer()->get($classname);
$name = $app->getName();
}
$options['mode'] = $app->get('sef');
return Router::getInstance($name, $options);
}
/**
* Gets the name of the current template.
*
* Inject the router or load it from the dependency injection container
* Example: Factory::getContainer()->get(SiteRouter::class);
*/
public static function getRouter($name = 'site', array $options = [])
{
return parent::getRouter($name, $options);
}
/**
* Gets the name of the current template.
*
protected function route()
{
// Get the full request URI.
$uri = clone Uri::getInstance();
$router = static::getRouter();
$result = $router->parse($uri, true);
$active = $this->getMenu()->getActive();
if (
// Mark afterInitialise in the profiler.
JDEBUG ? $this->profiler->mark('afterInitialise') : null;
// Route the application
$this->route();
// Mark afterRoute in the profiler.
JDEBUG ? $this->profiler->mark('afterRoute') : null;
if (!$this->isHandlingMultiFactorAuthentication()) {
$this->sanityCheckSystemVariables();
$this->setupLogging();
$this->createExtensionNamespaceMap();
// Perform application routines.
$this->doExecute();
// If we have an application document object, render it.
if ($this->document instanceof \Joomla\CMS\Document\Document) {
// Render the application output.
$this->render();
// Set the application as global app
\Joomla\CMS\Factory::$application = $app;
// Execute the application.
$app->execute();
* define() is used rather than "const" to not error for PHP 5.2 and lower
*/
define('_JEXEC', 1);
// Run the application - All executable code should be triggered through this file
require_once dirname(__FILE__) . '/includes/app.php';
[2/2]
TypeError
|
---|
TypeError: Joomla\CMS\WebAsset\WebAssetRegistry::addTemplateRegistryFile(): Argument #1 ($template) must be of type string, null given, called in /home/ijumponl/public_html/libraries/src/Error/Renderer/HtmlRenderer.php on line 58 at /home/ijumponl/public_html/libraries/src/WebAsset/WebAssetRegistry.php:300 at Joomla\CMS\WebAsset\WebAssetRegistry->addTemplateRegistryFile(null, 0) (/home/ijumponl/public_html/libraries/src/Error/Renderer/HtmlRenderer.php:58) at Joomla\CMS\Error\Renderer\HtmlRenderer->render(object(RuntimeException)) (/home/ijumponl/public_html/libraries/src/Exception/ExceptionHandler.php:136) at Joomla\CMS\Exception\ExceptionHandler::render(object(RuntimeException)) (/home/ijumponl/public_html/libraries/src/Exception/ExceptionHandler.php:73) at Joomla\CMS\Exception\ExceptionHandler::handleException(object(RuntimeException)) (/home/ijumponl/public_html/libraries/src/Application/CMSApplication.php:336) at Joomla\CMS\Application\CMSApplication->execute() (/home/ijumponl/public_html/includes/app.php:58) at require_once('/home/ijumponl/public_html/includes/app.php') (/home/ijumponl/public_html/index.php:32) |
[1/2]
RuntimeException
|
---|
RuntimeException: Unable to load router: site at /home/ijumponl/public_html/libraries/src/Router/Router.php:115 at Joomla\CMS\Router\Router::getInstance('site', array('mode' => '1')) (/home/ijumponl/public_html/libraries/src/Application/CMSApplication.php:642) at Joomla\CMS\Application\CMSApplication::getRouter('site', array('mode' => '1')) (/home/ijumponl/public_html/libraries/src/Application/SiteApplication.php:396) at Joomla\CMS\Application\SiteApplication::getRouter() (/home/ijumponl/public_html/libraries/src/Application/CMSApplication.php:1108) at Joomla\CMS\Application\CMSApplication->route() (/home/ijumponl/public_html/libraries/src/Application/SiteApplication.php:244) at Joomla\CMS\Application\SiteApplication->doExecute() (/home/ijumponl/public_html/libraries/src/Application/CMSApplication.php:306) at Joomla\CMS\Application\CMSApplication->execute() (/home/ijumponl/public_html/includes/app.php:58) at require_once('/home/ijumponl/public_html/includes/app.php') (/home/ijumponl/public_html/index.php:32) |