■xml宣言
<?xml version="1.0" encoding="Shift_JIS"?>これだけで書くとエラーになる。
たぶんみんな最初にこれでつまづくんだろね。
ぐぐったらすぐでてきた。
解決方法はいくつかあって、
・echoでだす。
・apache
とか。
今回はechoで出します。
<?php echo'<?xml version="1.0" encoding="Shift_JIS"?>'."\n"; ?>
■DOCTYPEの指定
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">・3キャリア別にDOCTYPE分ける場合のメモ
http://ma-san.org/2009/10/htmlphpdoctype.html
■Content-Typeヘッダの指定
<meta http-equiv="Content-Type" content="application/xhtml+xml ; charset=Shift_JIS" />今回はapacheでの設定ではなくレン鯖とか汎用的にいけるようにソースに。
app_controller.phpのbeforerenderで出力。
*)継承先のbeforerender()でparent:beforerender()を忘れずに。
APP/controller/app_controller.php
<?php class AppController extends Controller { function beforerender() { header('Content-Type: application/xhtml+xml'); } }
■エミュレータ
・docomohttp://www.nttdocomo.co.jp/service/imode/make/content/browser/html/tool2/index.html
・softbank
http://creation.mb.softbank.jp/web/web_tool.html
・au
http://www.au.kddi.com/ezfactory/tool/ue/
http://web.archive.org/web/*/developer.openwave.com/ja/tools_and_sdk/openwave_mobile_sdk/SDK62K/Openwave_SDK_62K.exe
・fireMobileSimulator
http://firemobilesimulator.org/