![]() |
Format url - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Format url (/showthread.php?tid=4500) |
Format url - El Forum - 11-28-2007 [eluser]JimmyJ[/eluser] Hey folks I was wondering if anyone could help me. Trying to work out cl, but having a few troubles just getting to grips with it (never used a framework before). Anyway, i'm pulling data from a database, and trying to format the string into seo urls and pass the id. Here's my code for welcome.php Code: <?php and here's the code for home.php Code: <ul> As you can see home.php is a mess. I would like to format the urls, lowercase and hyphens within the index function in welcome.php Can anyone give me any tips to work this out? Thanks Format url - El Forum - 11-28-2007 [eluser]Gavin Vickery[/eluser] You could format the values returned from your SQL, and assign them to a new variable before you send it to the view Code: function index() This makes your view very easy Code: <ul><?=$link_html?></ul> Obviously you don't need to break out the link in the index() function that much, I just did it for clarity. Hope that helps. |