Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'd suggest using a ton of elements. This way, you can still keep all of the code in one place. For example, if this is your home page layout (boilerplate excluded):</p> <pre><code>&lt;body&gt; &lt;?php echo $this-&gt;renderElement('pageHeader'); ?&gt; &lt;?php echo $this-&gt;renderElement('frontPageNotification'); ?&gt; &lt;?php echo $this-&gt;renderElement('navAndOtherStuff'); ?&gt; ... &lt;/body&gt; </code></pre> <p>And this is your interior layout (where you want to display everything except for the frontPageNotification stuff:</p> <pre><code>&lt;body&gt; &lt;?php echo $this-&gt;renderElement('pageHeader'); ?&gt; &lt;?php echo $this-&gt;renderElement('navAndOtherStuff'); ?&gt; ... &lt;/body&gt; </code></pre> <p>Now, if they're almost exactly alike, I would probably just use a single layout and have a few if statements within the layout itself to determine what's to be displayed. Also, you can choose which elements get displayed by looking at the $this->params array to figure out which controller and action is behind the page being loaded. Like:</p> <pre><code>&lt;body&gt; &lt;?php echo $this-&gt;renderElement('pageHeader'); ?&gt; &lt;?php if($this-&gt;params['controller'] == 'pages' &amp;&amp; $this-&gt;params['action'] == 'index') { echo $this-&gt;renderElement('frontPageNotification'); } ?&gt; &lt;?php echo $this-&gt;renderElement('navAndOtherStuff'); ?&gt; ... &lt;/body&gt; </code></pre> <p>Which is, admittedly, rather ugly. Just trying to present all the options I could think of :)</p> <p>Good luck</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload