Skip to main content
3 votes

Joomla 4 Views will not load on some Hosts

HtmlView.php is case-sensitive. Also, all other files within the src folder for namespacing are case-sensitive. That is what was causing all the problems.
Brent Cordis's user avatar
3 votes
Accepted

Loading a helper file in Joomla 4

JLoader::register() call should include fully qualified class name. In your case it's Myhelper\MyHelper: JLoader::register('Myhelper\Myhelper', 'templates/mytemplate/html/helper.php'); The class also ...
Sharky's user avatar
  • 11.5k
3 votes

How to bootstrap loading of all libs and plugins from command line?

That final piece of code seems to have done it. require_once JPATH_LIBRARIES . '/namespacemap.php'; $extensionPsr4Loader = new \JNamespacePsr4Map(); $extensionPsr4Loader->load();
Olle Härstedt's user avatar
2 votes
Accepted

Joomla 4 custom module namespace issue

Joomla uses PSR-4 autoloader. You must follow this convention for builtin autoloading to work. In your case you have to rename the helper file to match the class file, i.e. it should be /Helper/...
Sharky's user avatar
  • 11.5k
2 votes
Accepted

Using namespase USE in a module

The entry file is not used when calling AJAX. You have to move the loading of patientForm.php into the helper file, before the class declaration: defined('_JEXEC') or die; require_once 'libraries/...
Sharky's user avatar
  • 11.5k
2 votes
Accepted

Registering EasyPost library in J4 module - Class not found

Assuming you are using the same code for J3, it's working by coincidence. The library is using PSR4 autoloading but in J3 JLoader::registerNamespace() defaults to PSR0. Normally this wouldn't work but ...
Sharky's user avatar
  • 11.5k
2 votes
Accepted

Joomla 4 namespacing and autoloading

Thanks to @Zollie-- the plugin is enabled by default and does seem to work. You'd need to check the libraries/autoload_psr4.php to verify that your component's namespace (set in the new namespace ...
user101289's user avatar
  • 1,119
1 vote

Using a table from a library when namespaced

You can try either of these method that I have used in components. use Mylib\Library\Table\MyTable; ... $this->db = $this->db ? :Factory::getContainer()->get('DatabaseDriver'); $...
Irata's user avatar
  • 4,026
1 vote
Accepted

Joomla\Filesystem\File or Joomla\CMS\Filesystem\File

In the newer Joomla\Filesystem\File which is part of the Joomla Platform, there is no longer the method/function called exists() The exists() method called in the Joomla\CMS\Filesystem\File can be ...
Irata's user avatar
  • 4,026
1 vote
Accepted

How to use 3rd party libraries with a Namespace?

Without knowing what errors you're getting or what your Joomla code looks like I can only think of two potential issues. First is the unnecessary and wrong use of namespace declaration. If you add it ...
Sharky's user avatar
  • 11.5k
1 vote

Set and Retrieve Array in Joomla Session Namespace

The above method is 100% correct and working. My own code, where I had my_custom_namespace had a typo - I was setting myNamespace and trying - and obviously failing - to get MyNamespace :Faceplam:
Kaleb Thompson's user avatar
1 vote
Accepted

Library with namespace and autoloader example

I found the answer finaly i greated an example on github for who is intrested: https://github.com/basd82/joomla_libarary
Bas van den Dikkenberg's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible