My first question is about design templates. So far I've seen two ways to do it, making PHP files for the header, menu, footer, etc. and using include, or using Smarty. Are there any other common ways I should know about?
My second question is about the use of echo. Let's say I want to loop through a set of data and render some divs for each one. In RoR, it could be done like this:
Code: Select all
<% @data.each do |d| %>
<div id="some_div">
<p>blah blah</p>
</div>
<% end %>
Code: Select all
foreach ($data as $d)
{
echo "<div id ='some_div'>";
echo "<p>blah blah</p>";
echo "</div>";
}
Thanks!