Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/freewil/platform_detection

Dynamic layout/view theme selection in CakePHP based on user's platform thanks to browscap.ini
https://github.com/freewil/platform_detection

Last synced: about 1 month ago
JSON representation

Dynamic layout/view theme selection in CakePHP based on user's platform thanks to browscap.ini

Awesome Lists containing this project

README

        

# platform_detection

Dynamic layout/view [theme](http://book.cakephp.org/1.2/view/488/Themes)
selection in CakePHP based on user's platform thanks to
[browscap.ini](https://browsers.garykeith.com/downloads.asp).

## Tested with:
* PHP 5.3.6
* CakePHP 1.2

## Setup
Check that your install of PHP5 has the
[browscap config setting](http://php.net/manual/misc.configuration.php#ini.browscap)
pointing to a recent version of
[browscap.ini](https://browsers.garykeith.com/downloads.asp).

You can easily submodule the plugin into your existing CakePHP project:
`git submodule add https://github.com/freewil/platform_detection app/plugins/platform_detection`

Add the plugin's component and view helper to your AppController:

```php

mobileOverrideLink(); ?>

```

You may also add this to your normal non-themed layout for a
`View Mobile Site`:

```php

isMobileOverride()):
echo $platformDetection->mobileOverrideResetLink();
endif; ?>

```