MVC の Heredoc は、レイヤーの分離への進出を開始する良い方法ですか? 使用できる場所と、ヒアドキュメントが解決するよりも多くの問題を抱えている場所を読みました。
2 に答える
1
Heredoc is a method of sorts, but, no it is not a good way. Especially if you are doing this inside of the controller. You should separate your "view" logic into different files then you would just include the view you need depending on the controller / action.
Doing it as an include you can easily use <?php echo $variable; ?>
and do your view logic in that file. You might also consider using a prebuilt framework, such as Zend or Codeigniter, among others which take the MVC approach.
于 2010-09-24T21:35:01.310 に答える