echo the JBrowser::isMobile() method output browsing the page with an android smartphone
true
false
php 5.6.24
IIS 7
joomla 3.6
MySql 5.7
Category | ⇒ | Libraries |
Calling JBrowser::isMobile()
that why will give you a PHP error because that method is not made to call static. Instead use this:
$browser = JBrowser::getInstance();
$this->browser->isMobile();
hi tested until used on with template J3.6, is worked. You should need to "true/false", exemple:
[code]
$browser = JBrowser::getInstance();
if( $browser->isMobile() == true ){
#show on Mobile because = true
} else {
#show Desktop
}
[/code]
Closing as JBrowser::isMobile()
is not valid syntax and @alexonbalangue confirmed it worked with the correct syntax.
If it still not work on your site please open a new issue with your useragent information you can find in the backend under system information. Thanks.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-09-15 09:39:05 |
Closed_By | ⇒ | zero-24 |
See #6859