{"id":356,"date":"2008-07-10T17:51:05","date_gmt":"2008-07-10T08:51:05","guid":{"rendered":"http:\/\/ke-tai.org\/blog\/?p=356"},"modified":"2008-07-10T17:55:57","modified_gmt":"2008-07-10T08:55:57","slug":"cssdocomo2","status":"publish","type":"post","link":"http:\/\/ke-tai.org\/blog\/2008\/07\/10\/cssdocomo2\/","title":{"rendered":"\u30c9\u30b3\u30e2\u306eCSS\u3092\u30a4\u30f3\u30e9\u30a4\u30f3\u306b\u57cb\u3081\u8fbc\u3093\u3067\u304f\u308c\u308bPHP\u30e9\u30a4\u30d6\u30e9\u30ea\u300ctoInlineCSSDoCoMo\u300d(\u7d9a\u304d)"},"content":{"rendered":"<p>\u6628\u65e5\u304b\u3089\u3001\u30c9\u30b3\u30e2\u3067\u5916\u90e8CSS\u3084\u30b9\u30bf\u30a4\u30eb\u30bf\u30b0\u304c\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\uff30\uff28\uff30\u30e9\u30a4\u30d6\u30e9\u30ea\u3001\u300c<a href=\"http:\/\/blog.asial.co.jp\/411\" target=\"_blank\">toInlineCSSDoCoMo<\/a>\u300d\u306b\u5922\u4e2d\u3067\u3059\u3002<\/p>\n<p>\u8aad\u307f\u624b\u304c\u304b\u305f\u3088\u3063\u3066\u3057\u307e\u3046\u3053\u3068\u3092\u627f\u77e5\u306e\u4e0a\u3067\u3001\u7d9a\u7de8\u306e\u8a18\u4e8b\u3092\u66f8\u304b\u305b\u3066\u3044\u305f\u3060\u304d\u307e\u3059\u3002<\/p>\n<p>\u79c1\u306e\u4f5c\u6210\u3057\u305f\u30b5\u30a4\u30c8\u306fSmarty\u3092\u4f7f\u3063\u305f\u3082\u306e\u304c\u591a\u3044\u305f\u3081\u3001\u30d5\u30a3\u30eb\u30bf\u3092\u4f5c\u6210\u3057\u3088\u3046\u304b\u306a\u3068\u8003\u3048\u3066\u3044\u305f\u3089\u3001\u65e2\u306b\u540c\u3058\u3088\u3046\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u3044\u305f\u65b9\u304c\u3044\u307e\u3057\u305f\u3002<br \/>\n\u5f53\u30d6\u30ed\u30b0\u306b\u3044\u3064\u3082\u30b3\u30e1\u30f3\u30c8\u3092\u6234\u3044\u3066\u3044\u308bmaru_cc\u3055\u3093\u306e\u30d6\u30ed\u30b0\u3067\u3059\u3002<\/p>\n<p>\u2192\u3000<a href=\"http:\/\/d.hatena.ne.jp\/maru_cc\/20080709\/ethna_cssdocomo\" target=\"_blank\">PHP\u30e9\u30a4\u30d6\u30e9\u30ea\u300ctoInlineCSSDoCoMo\u300d\u3092Ethna\u306b\u7d44\u307f\u8fbc\u3093\u3067\u307f\u305f<\/a> <small>[hatena.ne.jp]<\/small><\/p>\n<p class=\"spacer-small\">&nbsp;<\/p>\n<p>\u3053\u3053\u3067\u306f\u3001Ethna\u306b\u300ctoInlineCSSDoCoMo\u300d\u3092\u7d44\u307f\u8fbc\u3080\u65b9\u6cd5\u304c\u7d39\u4ecb\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\nEthna\u4f7f\u3044\u306e\u65b9\u306f\u8981\u30c1\u30a7\u30c3\u30af\u3067\u3059\u306d\u3002<\/p>\n<p>\u3072\u3068\u307e\u305a\u79c1\u306fSmarty\u30d5\u30a3\u30eb\u30bf\u3060\u3051\u62dd\u501f\u3057\u3001\u4e00\u90e8\u3092\u4fee\u6b63\u3057\u3066\u5229\u7528\u3055\u305b\u3066\u3044\u305f\u3060\u304f\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p class=\"spacer-small\">&nbsp;<\/p>\n<p>\u3057\u304b\u3057\u5b9f\u969b\u306b\u52d5\u304b\u3057\u3066\u307f\u305f\u3068\u3053\u308d\u3001\u5e7e\u3064\u304b\u554f\u984c\u304c\u51fa\u3066\u304d\u307e\u3057\u305f\u3002<br \/>\n\u3069\u308c\u3082\u300ctoInlineCSSDoCoMo\u300d\u306e\u554f\u984c\u3068\u3044\u3046\u3088\u308a\u306f\u3001PEAR\u306e\u300cHTML_CSS\u300d\u306e\u554f\u984c\u306e\u3088\u3046\u3067\u3059\u3002<\/p>\n<p class=\"spacer-small\">&nbsp;<\/p>\n<p><strong>1. Warning\u30a8\u30e9\u30fc\u304c\u51fa\u308b<\/strong><\/p>\n<p>\u30b5\u30a4\u30c8\u5185\u306eHTML\u306e\u66f8\u304d\u65b9\u304c\u6c5a\u304f\u3001HTML\u3092\u30d1\u30fc\u30b9\u3059\u308b\u969b\u306b\u30a8\u30e9\u30fc\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u3088\u3046\u3067\u3059\u3002<br \/>\n\u3053\u3061\u3089\u306f\u5c11\u3057\u305a\u3064\u66f8\u304d\u76f4\u3057\u3066\u3044\u304f\u3057\u304b\u306a\u3044\u3067\u3059\u306d\u3002<\/p>\n<p>\u305f\u3060\u3001\u300c&lt;a id=&#8221;anchor&#8221; name=&#8221;anchor&#8221;&gt;&lt;\/a&gt;\u300d\u306e\u3088\u3046\u306a\u66f8\u304d\u65b9\u3067\u3082\u4f55\u6545\u304b\u30a8\u30e9\u30fc\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u305f\u3081\u3001\u56f0\u3063\u3066\u3044\u305f\u308a\u3057\u307e\u3059\u3002<\/p>\n<p>\u901a\u5e38\u306eCSS\u3068\u540c\u3058\u3088\u3046\u306b\u30a8\u30e9\u30fc\u3092\u51fa\u3057\u305f\u304f\u306a\u3044\u65b9\u306f\u3001\u300c@\u300d\u3067\u30a8\u30e9\u30fc\u6291\u6b62\u3092\u3059\u308b\u3068\u826f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u307e\u305fCSS\u30d5\u30a1\u30a4\u30eb\u304c\u8aad\u307f\u53d6\u308c\u306a\u304b\u3063\u305f\u5834\u5408\u3067\u3082\u3001Exception\u306b\u98db\u3093\u3067\u3044\u3063\u3066\u3057\u307e\u3046\u305f\u3081\u3001\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p class=\"spacer-small\">&nbsp;<\/p>\n<p><strong>2. \u6587\u5b57\u5316\u3051\u3057\u3066\u3057\u307e\u3046<\/strong><\/p>\n<p>HTML\u30d8\u30c3\u30c0\u5185\u306e\u6587\u5b57\u30b3\u30fc\u30c9\u6307\u5b9a\u306emeta\u30bf\u30b0\u3088\u308a\u524d\u306btitle\u30bf\u30b0\u304c\u3042\u3063\u305f\u5834\u5408\u306b\u306f\u3001\u6587\u5b57\u5316\u3051\u3057\u3066\u3057\u307e\u3046\u3088\u3046\u3067\u3059\u3002<br \/>\n\u8abf\u3079\u3066\u307f\u308b\u3068\u3001meta\u30bf\u30b0\u3092\u5148\u306b\u66f8\u304f\u306e\u304c\u6b63\u3057\u3044\u3088\u3046\u3067\u3059\u306d\u3002<br \/>\n\u4eca\u307e\u3067\u7279\u306b\u554f\u984c\u304c\u306a\u304b\u3063\u305f\u306e\u3067\u6c17\u3065\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002<\/p>\n<p class=\"spacer-small\">&nbsp;<\/p>\n<p><strong>3. non-object\u30a8\u30e9\u30fc\u3067\u6b62\u307e\u3063\u3066\u3057\u307e\u3046\u3053\u3068\u304c\u3042\u308b<\/strong><\/p>\n<p>style\u30bf\u30b0\u3067\u5185\u90e8CSS\u3092\u6307\u5b9a\u3057\u305f\u5834\u5408\u306b\u3001152\u884c\u76ee\u306e\u300c$parent->removeChild($node);\u300d\u3067\u30a8\u30e9\u30fc\u3068\u306a\u3063\u3066\u3057\u307e\u3046\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u540c\u3058style\u30bf\u30b0\u306e\u66f8\u304d\u65b9\u3067\u3082\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u5834\u5408\u3068\u3001\u51fa\u306a\u3044\u5834\u5408\u304c\u3042\u308b\u306e\u3067\u8a73\u7d30\u306f\u8abf\u67fb\u4e2d\u3067\u3059\u3002\uff08style\u30bf\u30b0\u81ea\u4f53\u3092\u524a\u9664\u3059\u308b\u3068\u76f4\u308a\u307e\u3059\uff09<br \/>\n\u3072\u3068\u307e\u305a152\u884c\u76ee\u306b\u3001\u300cif ($parent) {\u300d\u3092\u8ffd\u52a0\u3057\u56de\u907f\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p class=\"spacer-small\">&nbsp;<\/p>\n<p><strong>4. Smarty-&gt;fetch\u3067\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u53d6\u5f97\u3057\u3066\u308b\u5834\u5408\u3001outputfilter\u3067\u306f\u5bfe\u5fdc\u3067\u304d\u306a\u3044\u304b\u3082<\/strong><\/p>\n<p>\u79c1\u306e\u30b5\u30a4\u30c8\u3067\u306f\u3001\u3088\u304f\u4f7f\u3046\u8868\u793a\u30d6\u30ed\u30c3\u30af\u306f\u3001Smarty\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u95a2\u6570\u3092\u4f5c\u6210\u3057\u3001\u72ec\u81ea\u30bf\u30b0\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u6700\u65b0\u30cb\u30e5\u30fc\u30b9\u3092\u8868\u793a\u3057\u305f\u3044\u3068\u304d\u306b\u306f\u3001\u30bf\u30b0\u300c{displayNews num=&#8221;5&#8243;}\u300d\u3067\u8868\u793a\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\uff08\u3053\u3046\u3059\u308b\u3068\u3001\u3042\u3061\u3053\u3061\u3067\u30cb\u30e5\u30fc\u30b9\u3092\u8868\u793a\u3067\u304d\u3066\u4fbf\u5229\u306a\u305f\u3081\u3067\u3059\uff09<\/p>\n<p>\u5185\u90e8\u3067\u306fsmarty->fetch\u30e1\u30bd\u30c3\u30c9\u3067\u30cb\u30e5\u30fc\u30b9\u3092\u53d6\u5f97\u3057\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001fetch\u306b\u5bfe\u3057\u3066\u3082outpufilter\u304c\u52b9\u3044\u3066\u3057\u307e\u3044\u307e\u3059\u3002<br \/>\nfetch\u3055\u308c\u308b\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306f\u5f53\u7136\u30d8\u30c3\u30c0\u60c5\u5831\u306a\u3069\u3092\u6301\u3063\u3066\u3044\u307e\u305b\u3093\u306e\u3067\u3001outputfilter\u3068toInlineCSSDoCoMo\u3068\u306e\u76f8\u6027\u306f\u3001\u3042\u307e\u308a\u826f\u304f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u300cob_start([\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570])\u300d\u3092\u5229\u7528\u3057\u3001\u51fa\u529b\u76f4\u524d\u306e\u60c5\u5831\u306b\u5bfe\u3057\u3066\u3001\u51e6\u7406\u3092\u884c\u3046\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u306e\u30b5\u30f3\u30d7\u30eb\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre class=\"super-pre-small\"><code>&lt;?php\r\n\/\/ ob\u30d5\u30a3\u30eb\u30bf\u306e\u8a2d\u5b9a\r\nob_start('ob_filter_cssdocomo');\r\n\r\nfunction ob_filter_cssdocomo($out)\r\n{\r\n  require_once 'toInlineCSSDoCoMo.php';\r\n  $basedir = dirname($_SERVER['SCRIPT_FILENAME']) . '\/';\r\n  try {\r\n    $buf = toInlineCSSDoCoMo::getInstance()->setBaseDir($basedir)->apply($out);\r\n  } catch (Exception $e) {\r\n    \/\/ \u30a8\u30e9\u30fc\u51e6\u7406\u3078\r\n  }\r\n  return $buf;\r\n}\r\n?&gt;\r\n<\/code><\/pre>\n<p>\u4eca\u306e\u3068\u3053\u308d\u3001\u3053\u308c\u3067\u4e00\u901a\u308a\u3046\u307e\u304f\u3044\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\u3082\u3046\u5c11\u3057\u8a66\u884c\u932f\u8aa4\u304c\u5fc5\u8981\u3067\u3059\u304c\u3001\u5feb\u9069\u306aHTML\u88fd\u4f5c\u306b\u5411\u3051\u3066\u30011\u6b69\u524d\u9032\u3067\u3059\u3002<\/p>\n<p class=\"spacer\">&nbsp;<\/p>\n<p><strong><em>\u95a2\u9023\uff1a<\/em><\/strong><\/p>\n<ul>\n<li><em><a href=\"http:\/\/ke-tai.org\/blog\/2008\/07\/09\/toinline\/\">\u30c9\u30b3\u30e2\u306eCSS\u3092\u30a4\u30f3\u30e9\u30a4\u30f3\u306b\u57cb\u3081\u8fbc\u3093\u3067\u304f\u308c\u308bPHP\u30e9\u30a4\u30d6\u30e9\u30ea\u300ctoInlineCSSDoCoMo\u300d<\/a><\/em><\/li>\n<li><em><a href=\"http:\/\/ke-tai.org\/blog\/2008\/05\/02\/sfpictgra\/\">\u7d75\u6587\u5b57\u30e9\u30a4\u30d6\u30e9\u30ea\u300csfPictogramMobilePlugin\u300d\u304c\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u3057\u3001PEAR\u30d1\u30c3\u30b1\u30fc\u30b8\u5316\u3055\u308c\u305f\u3088\u3046\u3067\u3059<\/a><\/em><\/li>\n<li><em><a href=\"http:\/\/ke-tai.org\/blog\/2008\/01\/17\/emoji_json\/\">Asial blog\u3067\u7d75\u6587\u5b57\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u76f8\u4e92\u5909\u63db\u30de\u30c3\u30d4\u30f3\u30b0\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306eJSON\u30d5\u30a1\u30a4\u30eb\u304c\u516c\u958b\u3055\u308c\u3066\u3044\u307e\u3059<\/a><\/em><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u6628\u65e5\u304b\u3089\u3001\u30c9\u30b3\u30e2\u3067\u5916\u90e8CSS\u3084\u30b9\u30bf\u30a4\u30eb\u30bf\u30b0\u304c\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\uff30\uff28\uff30\u30e9\u30a4\u30d6\u30e9\u30ea\u3001\u300ctoInlineCSSDoCoMo\u300d\u306b\u5922\u4e2d\u3067\u3059\u3002 \u8aad\u307f\u624b\u304c\u304b\u305f\u3088\u3063\u3066\u3057\u307e\u3046\u3053\u3068\u3092\u627f\u77e5\u306e\u4e0a\u3067\u3001\u7d9a\u7de8\u306e\u8a18\u4e8b\u3092\u66f8\u304b\u305b\u3066\u3044\u305f\u3060\u304d\u307e\u3059\u3002 \u79c1\u306e\u4f5c\u6210 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[13,10],"tags":[89,672,134],"_links":{"self":[{"href":"http:\/\/ke-tai.org\/blog\/wp-json\/wp\/v2\/posts\/356"}],"collection":[{"href":"http:\/\/ke-tai.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/ke-tai.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/ke-tai.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/ke-tai.org\/blog\/wp-json\/wp\/v2\/comments?post=356"}],"version-history":[{"count":0,"href":"http:\/\/ke-tai.org\/blog\/wp-json\/wp\/v2\/posts\/356\/revisions"}],"wp:attachment":[{"href":"http:\/\/ke-tai.org\/blog\/wp-json\/wp\/v2\/media?parent=356"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/ke-tai.org\/blog\/wp-json\/wp\/v2\/categories?post=356"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/ke-tai.org\/blog\/wp-json\/wp\/v2\/tags?post=356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}