• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Practical Examples Using URI Segments For URL's

#3
[eluser]n0xie[/eluser]
To expand on the example:
Code:
class News extends Controller {

  // url: domain.tld/news
  // shows a list of news items with teasers
  function index() {}

  // url: domain.tld/news/sort/$sortby/$direction
  // shows a list of news items with teasers sorted a specific way for example date
  function sort($sortby, $direction = 'DESC') {}

  //url: domain.tld/news/article/$id
  // shows a specific news item plus full news content
  function article($id) {}

  //url: domain.tld/news/add
  // adds a news item
  function add() {}

  //url: domain.tld/news/edit/$id
  // edit a news item with specific $id
  function edit($id) {}

  //url: domain.tld/news/delete
  // delete a news item with specific $id using POST
  function delete() {}


Messages In This Thread
Practical Examples Using URI Segments For URL's - by El Forum - 10-26-2010, 12:02 PM
Practical Examples Using URI Segments For URL's - by El Forum - 10-26-2010, 04:11 PM
Practical Examples Using URI Segments For URL's - by El Forum - 10-26-2010, 04:23 PM
Practical Examples Using URI Segments For URL's - by El Forum - 10-26-2010, 07:20 PM
Practical Examples Using URI Segments For URL's - by El Forum - 10-26-2010, 07:30 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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