Bir PHP tabanlı ticaret ürünü Magento kullanarak bir web sitesi oluşturmak.
Ben sorun ben sekmeli navigasyon kullanmak istiyor.
Benim fikrim URL tabanlı ilgili Navigasyon menü öğesi üzerinde TAB göstermek için CSS kullanmak oldu.
Ancak bir URL her zaman değişir, bu yüzden ben bir şekilde bir ifelse deyimini kullanmak istedim.
Ben işe yarayabilir düşünüyorum iki yöntem, herhangi uzmanlar ne düşünürdüm iyi olduğunu söyle ve bunu nasıl uygulayacağını ile geldim?
Method 1
<div id="nav">
<ul id="mainnav">
<li><a href="index.php" title="Welcome page" <?php if ($page == 'index.php') { ?>class="active"<?php } ?>>Welcome</a></li>
<li><a href="about_us.php" title="About us page" <?php if ($page == 'about_us.php') { ?>class="active"<?php } ?>>About us</a></li>
<li><a href="services.php" title="Services page" <?php if ($page == 'services.php') { ?>class="active"<?php } ?>>Services</a></li>
<li><a href="testimonials.php" title="Testimonials page" <?php if ($page == 'testimonials.php') { ?>class="active"<?php } ?>>Testimonials</a></li>
<li><a href="contact_us.php" title="Contact us page" <?php if ($page == 'contact_us.php') { ?>class="active"<?php } ?>>Contact us</a></li>
else
<li><a href="store.php" title="Store Page" <?php ($page == 'store.php') { ?>class="active"<?php } ?>>Store</a></li>
</ul>
</div>
Method 2
$URL = store.php;
SWITCH ($sample) {
CASE home.php:
<li><a href="index.php" title="Welcome page" <?php if ($page == 'index.php') { ?>class="active"<?php } ?>>Welcome</a></li>
break;
CASE services.php:
<li><a href="services.php" title="Services page" <?php if ($page == 'services.php') { ?>class="active"<?php } ?>>Services</a></li>
break;
CASE aboutus.php:
<li><a href="about_us.php" title="About us page" <?php if ($page == 'about_us.php') { ?>class="active"<?php } ?>>About us</a></li>
break;
DEFAULT:
<li><a href="store.php" title="Store Page" <?php ($page == 'store.php') { ?>class="active"<?php } ?>>Store</a></li>
}