title: PHP - Detect homepage in template of script?
body: <p>How to detect home page in php from main index.php of script. So I have that script. This script is main page of script (not template's index.php</p>
  
  <pre><code>&lt;?php
  
  $view-&gt;title = $LANG["HOMEPAGE_TITLE"];
  $view-&gt;description = $LANG["HOMEPAGE_DESCRIPTION"];
  $view-&gt;keywords = $LANG["HOMEPAGE_TAGS"];
  
  if ($view-&gt;nav == 'homepage') {
      // ONLY FOR HOME PAGE
      $view-&gt;header = $view-&gt;render(DIR_TEMPLATE.WEBSITE_TEMPLATE.'/header.php');
      $view-&gt;footer = $view-&gt;render(DIR_TEMPLATE.WEBSITE_TEMPLATE.'/footer.php');
  } else { 
      // FOR OTHER ALL PAGE
      $view-&gt;header = $view-&gt;render(DIR_TEMPLATE.WEBSITE_TEMPLATE.'/header-common.php');
      $view-&gt;footer = $view-&gt;render(DIR_TEMPLATE.WEBSITE_TEMPLATE.'/footer-common.php');
  }
  
  echo $view-&gt;render(DIR_TEMPLATE.WEBSITE_TEMPLATE.'/index.php'); //This file home page file
  </code></pre>
  
  <p>I have enter this code but it doesn't detect home page
  And I have put this code to index.php (home page). How can I detect is homepage? I have put nav id but it also could not detect.</p>
  
  <pre><code>&lt;?php echo $header;?&gt;  
  //HOME PAGE CONTENT 
  &lt;?php echo $footer;?&gt;
  </code></pre>