separating html from code in php
Posted: Sat Oct 15, 2011 5:24 pm
Hi all,
I have a quick question. I come from the Java world where it is stressed (without end) the importance of separating code from html (using controller servlets that generate objects, that are passed to jsps, that use a tag library or such within the html... or some similar variation).
In general, the rule is that within JSPs, one should not put scirplets (java code) intermingled with html.
I am now exploring the PHP world, and it seems to me that PHP is pretty much written like JSP with scriplets. Browsing the major tutorials on PHP, it appears that it is pretty common practice to have html with intermingled PHP code. My question is, is this standard practice within PHP?
Thanks,
I have a quick question. I come from the Java world where it is stressed (without end) the importance of separating code from html (using controller servlets that generate objects, that are passed to jsps, that use a tag library or such within the html... or some similar variation).
In general, the rule is that within JSPs, one should not put scirplets (java code) intermingled with html.
I am now exploring the PHP world, and it seems to me that PHP is pretty much written like JSP with scriplets. Browsing the major tutorials on PHP, it appears that it is pretty common practice to have html with intermingled PHP code. My question is, is this standard practice within PHP?
Thanks,