I am starting to complete the namespacing of the admin components in J4 but I am only a trained monkey
I can see some existing namespacing that looks like this
use Joomla\CMS\Help\Help as JHelp;
$this->page = JHelp::createUrl(\JFactory::getApplication()->input->get('page', 'JHELP_START_HERE'));
Is that just "lazy" coding to avoid having to rename every instance in the file of JHelp
Is it not more correct to be changed to
use Joomla\CMS\Help\Help;
$this->page = Help::createUrl(\JFactory::getApplication()->input->get('page', 'JHELP_START_HERE'));
Labels |
Added:
?
|
I know its valid but if I am going to do this I want to do it right - thats why I was checking ;)
(there was a typo in my code above that I just fixed)
Thanks
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-06-29 08:14:28 |
Closed_By | ⇒ | brianteeman |
Yup as Thomas said - it was just lazy - I think I did this very early on to try and help with the merge conflicts (a slash to remove would have been easier) but when we went back and namespaced the libraries in 3.x it became totally useless.
Yes, first one is "lazy", but it's valid as well.
In the second case, you would have to change
JHelp
in the code toHelp
. SoJHelp::createUrl
becomesHelp::createUrl