You don't need to create a whole new application instance just to read client information. You can use Joomla\Application\Web\WebClient class directly. But in CMS context you can get it through current application instance:There is also Joomla\CMS\Environment\Browser class:Not sure which one is more reliable in terms of detection.
Code:
Joomla\CMS\Factory::getApplication()->client->mobile
Code:
Joomla\CMS\Environment\Browser::getInstance()->isMobile()
Statistics: Posted by SharkyKZ — Wed Apr 03, 2024 5:17 am