CodeIgniter Forums
Routeing Help - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forum-22.html)
+--- Thread: Routeing Help (/thread-51483.html)



Routeing Help - El Forum - 05-05-2012

[eluser]methos112[/eluser]
Greetings my fellow CI developers. I have been recently tasked to make changes to our website. I've been able to successfully create a test area before i can break anything.

Under the view folder I have:
Code:
<div class="apt_right">
   <h3><a href="&lt;?=$apartment-&gt;url;?&gt;" title="&lt;?=$apartment-&gt;keywords;?&gt;">&lt;?=$apartment->name;?&gt;</a></h3>
   <p>&lt;?=$apartment->address;?&gt;</p>
   <p><em class="tollfree">&lt;?=$apartment->tollfree;?&gt;</em></p>
   <p><em class="tollfree">&lt;?=$apartment->phone;?&gt;</em></p>
  </div>

I've determined that
Code:
&lt;?=$apartment->url;?&gt;
is referring to the field in my db. However when I click on the link (on the test page i get a 404), on the live site it is up and running perfectly.

In routes.php, I noticed that the 'default_controller' is set to 'home' and an a path for one of the links is
Code:
$route['apg3'] = 'home/ae/3';



Routeing Help - El Forum - 05-05-2012

[eluser]InsiteFX[/eluser]
Code:
$route['apg/(:any)'] = 'home/ae/$1';



Routeing Help - El Forum - 05-05-2012

[eluser]methos112[/eluser]
I've looked at that in the user guide, but I'm trying to understand why the links aren't working. We've copied the entire directory and db to set up our test bed, and I've adjusted the base_url and database.php file to reflect those changes.


Routeing Help - El Forum - 05-05-2012

[eluser]InsiteFX[/eluser]
CodeIgniter Users Guide - URL Helper - See the anchor() tag

Make sure you load the url helper!

Example:
Code:
&lt;?php echo anchor('news/local/123', 'My News', 'title="News title"'); ?&gt;

// Produces
<a href="http://example.com/index.php/news/local/123" title="News title">My News</a>




Routeing Help - El Forum - 05-06-2012

[eluser]methos112[/eluser]
how much of a difference in the framework is version 1.7.x to 2.x.x?


Routeing Help - El Forum - 05-06-2012

[eluser]CroNiX[/eluser]
This should pretty much spell it out:
CI Changelog
Upgrading from a Previous Version