Welcome Guest, Not a member yet? Register   Sign In
best way to create links
#1

[eluser]charlie spider[/eluser]
Hi everybody, just downloaded ci yesterday. Have only been programming for about 6 months or so using PHP, MySQL and CSS, but want to be able to better reuse code etc.

ci looks great

Just started to develop a new site and wanted to fish for peoples opinions regarding the best way to create links for the site's navigation using ci. i'm totally new to MVC and prefer to do things properly right from the start.

should i create the full link structure first:
ie: <a href="www.mysite.com/index.php">home page</a>
then feed that into an array and pass it to my view page ?

or should i feed the separate pieces into separate arrays (or a multidimensional array) and then assemble the pieces in my view ?

i'm thinking the first way seems to make the most sense.

And secondly, when using the URL Helper, i understand how site_url() works and i understand how auto_link() works, but is there any way to input the text portion for the link. Using my example above:
<a href="www.mysite.com/index.php">home page</a>
How do i input "home page" into site_url() and/or auto_link() ???

if it wasn't midnight already i would prolly just figure this out myself, but i'm tired and want to cut corners and have smart people tell me what's best.

Any ingenious insights into ci and creating links would be greatly appreciated.

Thanks in advance.
#2

[eluser]charlie spider[/eluser]
ergh...

totally missed anchor().

how many of you people was snickering at me ?

hee hee




Theme © iAndrew 2016 - Forum software by © MyBB