#RAKUSMeetup
つまり、こういうこと。
何も考えずにやると、各ロジックで新UIの分岐が増殖する
// javascriptが文字列で定義
$js = "";
$js .= "alert(123);";
$js .= "";
// DBアクセス
$sql = "select * from hoge_table";
$result = $db->exec($sql);
// 何かのロジック
$hoge = commonFunction();
// 突然のprintでHTML出力
if ($hoge === "hoge") {
print "
";
print "hogehoge";
print "
";
} else if ($hoge === "fuga") {
print "
";
print "fugafuga";
print "
";
} else {
print "
";
print "piyooo";
print "
";
}
~~~
// 突然のprintでHTML出力
if ($hoge === "hoge") {
if ($isNewUI) {
print "
";
print "new ui is cool.";
print "
";
} else {
print "
";
print "hogehoge";
print "
";
}
} else if ($hoge === "fuga") {
print "
";
print "fugafuga";
print "
";
} else {
if ($isNewUI) {
print "new ui is cool.";
}
print "
";
print "piyooo";
print "
";
}