Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 725 Bytes

Mobile.md

File metadata and controls

18 lines (13 loc) · 725 Bytes

Mobile component

The mobile component can hold the information of whether to serve a mobile layout based on session preference and browser headers.

// In your controller (action)
$isMobile = $this->Mobile->isMobile();

You can provide a form/button in the bottom of the layout that can switch a session variable to overwrite the browser detection: Just store the user's choice in the 'User.mobile' session key.

Configuration

'on' => 'beforeFilter', // initialize (prior to controller's beforeRender) or startup
'engine' => null, // CakePHP internal if null
'themed' => false, // If false uses subfolders instead of themes: /View/.../mobile/
'auto' => false, // auto set mobile views