User tests: Successful: Unsuccessful:
Namespaces JHtml
class and adds the possibility to add class prefixes to look for. Similar to what we did for JForm
in #15893.
To showcase the whole thing the JHtmlJquery
class got namespaced and com_content on the front and back end.
When merged, then I will port it back to the 3.8 branch.
How to register class prefixes needs to be documented.
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_content Front End Libraries |
Labels |
Added:
?
|
Milestone |
Added: |
Milestone |
Added: |
Any feedback here? Honestly I would like to get that into 3.8.
I like the manual registering approach, but I guess extension devs would like to get some autoload routine similar to what we have right now. I guess both can work together.
Honestly, we need to stop going with a "register X class name and Y class namespace to find classes/files in" approach system wide. Sooner or later it will cause there to be conflicts if two extensions are trying to use the same short class name which exists in two different namespaces. If someone loaded the paths for the JHtml helpers in the com_users frontend and backend, depending on what order the paths were loaded in (same will apply to namespaces), they may or may not get the correct JHtmlUsers class. The only way you can guarantee that you are using the correct class with the current setup is to be able to use the fully qualified class name when calling JHtml::_()
or to have a globally unique shortcut alias which points to a single class.
Explicitly loading helpers into a registry eliminates this conflict. The only requirement that my registry has is that your class has to be loaded before adding it to the registry. With our shift to autoloading extension classes, this is a non-issue.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-08-21 14:47:09 |
Closed_By | ⇒ | laoneo |
Any feedback here?