Yii 1.1: browser

Detect a user's browser

Browser is a simple wraper for the Browser Class, which is included.

Check the Browser Class often for new browsers or platforms.

This a very, very quick alpha release. Recomendations, comments, bugs are welcome but please use the forum.




  • Yii 1.1.1 (only tested with this version).


  • Extract the release file under protected/extensions


In your config.php file, in the components section, add the following:

'browser' => array(
    'class' => 'application.extensions.Browser.CBrowserComponent',

Then, in your controller or view, use it like this:

$browser = Yii::app()->browser->getBrowser();
$platform = Yii::app()->browser->getPlatform();

Change Log

April 4, 2010

  • Initial release.

Total 3 comments

#15061 report it
omeraslam at 2013/10/03 08:20am
Browser class at GitHub

this page no longer exists

#9925 report it
karminski at 2012/09/23 03:51am
Browser class at GitHub

Browser class is no longer available on Chris Schuld's blog, but can be found at GitHub repository (thanks to gavroche GitHub user).

#5330 report it
cass at 2011/10/05 06:35am
Browser class has been updated...

This component works great, but if you need to detect ipads make sure you update the browser detection class to the latest version at http://chrisschuld.com/projects/browser-php-detecting-a-users-browser-from-php.

Leave a comment

Please to leave your comment.

Create extension