how to customize cakephp website for iphone
I have a website which runs on CakePHP, how do i make my website look better on iphone and ipad?
Is there a plugin i can install and get some advantage or i have to design a 开发者_JAVA技巧custom CSS for iphone and use the same when a particular device type is detected.
You will have to create a new mobile layout, and change the layout depending on what type of device the user is accessing the site from.
So inside your app_controller.php
you have to add the RequestHandler
component to the $components
property array, then with the beforeFilter
function you could use something like this.
function beforeFilter() {
if ($this->RequestHandler->isMobile()) {
$this->layout = 'mobile_layout';
}
}
You need to custom your website to fit on the iphone or ipad Here is a simple tutorial about it
http://www.boutell.com/newfaq/creating/iphone.html
Stoosh is correct.
Rather than creating a new layout in CakePHP you could use CSS media queries to supply sensible styles for mobile.
@media only screen and (max-device-width: 480px) {
/* Iphone styles go here */
}
This will allow the browser to select the best styles to use regardless of device type.
精彩评论