HTMLHelper::_('stylesheet', 'media/com_phocacart/css/main.css', array('version' => 'auto'));
User.css will be loaded after component CSS (main.css)
User.css is loaded before component CSS (main.css)
Joomla 4.0.2
Labels |
Added:
No Code Attached Yet
|
Hi, thank you for the info.
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->registerAndUseStyle('com_phocacart', 'media/com_phocacart/css/main.css');
This did the trick. But the question is how many developers will use this latest method if the standard methods still work.
Many of them, that a question of the time.
We cannot easily drop the old way. For j4.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-09-30 20:17:29 |
Closed_By | ⇒ | Fedik |
Please try WebAsset instead https://docs.joomla.org/J4.x:Web_Assets
All call of
HTMLHelper::_('stylesheet or script', ...
still works, but they attached last.