Welcome Guest, Not a member yet? Register   Sign In
Can you suggest a better URI vs CRUD system for a forum?
#2

[eluser]CodeIgniteMe[/eluser]
a separate function for each functionality is more object-oriented way of getting things done as to simplify the code contents.
you can use the routes to re-route the execution to your CRUD controller:

This example route will trigger once he encounters each of your given example routes
Code:
$route['(create|edit|delete)/(category|topic|post)/(:any)'] = 'CRUD/$1/$2/$3';
$route['(create|edit|delete)/(category|topic|post)'] = 'CRUD/$1/$2';

then at the controller, you can try it by having something like this

Code:
<?php
class CRUD extends CI_Controller{
function create($param1,$param2='')
{
  echo $param1.'<br/>'.$param2;
}
function edit($param1,$param2='')
{
  echo $param1.'<br/>'.$param2;
}
function delete($param1,$param2='')
{
  echo $param1.'<br/>'.$param2;
}
}


Messages In This Thread
Can you suggest a better URI vs CRUD system for a forum? - by El Forum - 06-20-2012, 11:29 PM



Theme © iAndrew 2016 - Forum software by © MyBB