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

[eluser]nullsys[/eluser]
HI Philterm,
Thanks for that, I've been playing around, modified it further and come up with this:

Code:
public function create($param1='',$param2='')
{
  if ($param1 === "category" OR $param1 === "topic" OR $param1 === "post")
  {
    $this->load->helper('form');
    $this->load->library('form_validation');
    if ($this->form_validation->run('create_'.$param1) === FALSE)
    {
     $this->load->view('forum/create_'.$param1);
    }
    else
    {
     //Work with the model and create entries
    }
  }
  else
  {
   //URL failure, no matches
  }
}

The reasoning behind it is trying to keep DRY code. Rather can repeat functions for each "category", "topic" etc. I can just use create(), edit(), etc.

Can you seen any problems with this?


Messages In This Thread
Can you suggest a better URI vs CRUD system for a forum? - by El Forum - 06-21-2012, 10:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB