Hi all,i've found a nice code atA List Apart: Articles: Keeping Navigation Current With PHP..
What i'm askin is hot to make it as a function??There is no problem if i use it without making it as a function...Thanks a lot..
keeping navigation current
Started by yonghan, Mar 25 2009 05:54 AM
1 reply to this topic
#1
Posted 25 March 2009 - 05:54 AM
|
|
|
#2
Posted 28 March 2009 - 07:20 AM
Hi Yonghan,
You would make it something like this:
and you would use it like this:
I didn't read the full article so this may need tweaking, but I don't think it will. If you have any further questions please feel free to ask :)
Hoped it helped,
Matt
You would make it something like this:
<?php
function CurrentPage($Page)
{
if ($thisPage==$Page)
{
echo " id=\"currentpage\"";
}
}
?>
and you would use it like this:
<li<?php CurrentPage("Page One");?>>
<a href="#">Page One</a></li>
I didn't read the full article so this may need tweaking, but I don't think it will. If you have any further questions please feel free to ask :)
Hoped it helped,
Matt


Sign In
Create Account


Back to top









