Quick link building library |
[eluser]awpti[/eluser]
Code: <?php Tabbing is a tad goofed, but it works quite well. Very simple: Code: $this->awpnav->css_class = 'current'; This added about 0.003 seconds to the page render time - don't know if that's horrible, but it seems to run well under a load. Hope someone finds this useful in some way! This is my first-ever foray into developing my own library. Comments are appreciated even if you don't have a use for it. I'd love to know what I could do better and what, if any, bad practices I may be approaching. You can see it in-action on onlytechnews.com and the source here: http://onlytechnews.com/source/libraries/Otnnav.phps http://onlytechnews.com/source/controlle...front.phps These are symlinks, so any changes I make are reflected instantly. Cheers.
[eluser]xwero[/eluser]
From my point of view i wouldn't do this in a class but as a helper. There are a few reasons for this - i think the menu will not be build in the controller - if you put awpmenu() in the view it can take advantage of the the current uri_string and compare it with the links - i think creating html should be done using a view file for more configuration But i say it again my view on things your method works already.
[eluser]dawnerd[/eluser]
Yea, I agree with xwero. Html should be produced in the view file. It;s really bad habit to put html in a function. |
Welcome Guest, Not a member yet? Register Sign In |