• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Basic question : how to link using codeigniter

#1
[eluser]bill19[/eluser]
Hi everyone,

I am working on assembling a small mainly informational website using twitter bootstrap, and I'm unsure what the best practices are for basic internal linking and navigation with codeigniter as part of the project.

As an example I have the following button:

Code:
<p><a class="btn">Learn more »</a></p>

I want to link to a second page with this button. How can I do this with CI, or should I be using CI at all?

Thank you in advance,

Bill

#2
[eluser]CroNiX[/eluser]
I'm not really understanding your question. It would just be a link to whatever page you want them to go to like any other link.

Code:
<p><a class="btn" href="http://yoursite.com/controller/next_url">Learn more »</a></p>
or (CI Way)
Code:
<p>&lt;?php echo anchor('controller/next_url', 'Learn More »', 'class="btn"'); ?&gt;</p>

#3
[eluser]bill19[/eluser]
Thanks for answering CroNiX,

For best practices should I have a controller in the mix for each page or just have the pages link directly to each other in areas of the site where I am not using php ( just displaying static informational views ) ?

Thanks,

Bill


#4
[eluser]CroNiX[/eluser]
The theory is that if HTML specs change, like adding another attribute or something, you'd only have to update the helper code for anchor() (in this case) and it will fix all of your anchors site-wide, assuming you used the anchor() function for each one. Where if you made them all by hand you have to update them all by hand, which may or may not be trivial depending on the size of your application and how many anchors were used.

#5
[eluser]bill19[/eluser]
I will read up on CI's anchor().

Thanks,

Bill


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.