'Is there EL / JTSL tag-ish for PHP display pages?
So I have studied Java-based web app in my Uni, where I use Servlets for backend and JSP for frontend display
Now I decided to learn PHP.
I notice that PHP use similar concept like "scriplet" in JSP where we would jump in and out of HTML and "code section", like
<div>
<%
if(x>y){
%>
<p> hello world </p>
<%
} else {
%>
<p> hi world</p>
<%
}
%>
</div>
Which can create confusion for large pages. However, in JSP we can use EL or JSTL to utilize tags to help the page more readable, like
<c:choose>
<c:when test="${x>y}"> Hello World </c:when>
<c:otherwise> Hi World </c:otherwise>
</c:choose>
Which would greatly help readability.
So my question is, Are there any similar technology in PHP? Or I must code in similar fashion as "scriplet" with <?php ?>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
