RenderBody in php
<p>If you have used ASP.NET MVC you'd be familiar with RenderBody. Basically, you have one layout page and several body pages. Something like this:</p>

<p>layout.cshtml:</p>

<pre><code>&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;Your Title&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    @RenderBody()
  &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>index.cshtml:</p>

<pre><code>@{
   layout = "layout.cshtml";
}

&lt;p&gt;Hello World!&lt;/p&gt;
</code></pre>

<p>So when you call index.cshtml, all of its content will be shown in the layout's <code>@RenderBody</code> section. This is really useful when your pages use a single layout. </p>

<p>Now, my question is, how could I achieve something similar to the code above in php?</p>

<p><strong>EDIT</strong></p>

<p>For those who are not familiar with ASP.NET, when you have an index2.cshtml file like this:</p>

<pre><code>@{
   layout = "layout.cshtml";
}

&lt;p&gt;Hello World, once again!&lt;/p&gt;
</code></pre>

<p>Then when you call index2.cshtml this time 'Hello World, once again!' would be printed. So basically, when you define the page's layout, all of its content is displayed in the @RenderBody section of its layout. You don't have to explicitly define what page to include in the layout. </p>
