Welcome Guest, Not a member yet? Register   Sign In
URI segment passing to functions doesn't work
#1

[eluser]blazarian[/eluser]
Why the default uri segment passing to functions doesn't work for me? I use it like in the example mentioned in here.

I haven't changed or routed anything so why this method isn't working out of the box? I mean what do I need to check? The parameter just doesn't pass to function.
#2

[eluser]danmontgomery[/eluser]
Have you enabled profiling to see what CI has determined is the URI?
What happens when you pass parameters in the URI? Does it still go to the correct controller/method?
Does it work if you enable routing?
What URI are you going to? What does the code look like?
#3

[eluser]blazarian[/eluser]
Yes the controller and method loads normally but the parameters just won't pass to the method. The variable that should contain the passed value is 0 whatever I do. So the problem is with the parameter passing and I have no clue where's the problem.
#4

[eluser]danmontgomery[/eluser]
Post the URI you're using and the relevant function
#5

[eluser]blazarian[/eluser]
...index.php/kokonaisuus/create/1

Code:
function create($projekti_id)
    {
        $this->validate();

        if($this->validation->run() == false)
        {
            $this->template->write('title', 'Polku - Luo uusi kokonaisuus');
            $this->template->write_view('content', 'kokonaisuus/create');
        }
        else
        {
            $this->Kokonaisuus->insertKokonaisuus($projekti_id);
            redirect('projekti/read/'.$projekti_id,'refresh');
        }

        $this->template->render();
    }

Dunno what I'm missing. Maybe some stupid mistake from me somewhere... although I have checked things couple times over.
#6

[eluser]blazarian[/eluser]
Would be awesome to have this problem solved if anyone could tell me what to check or where might be some kinda problem? Sorry for posting again, but I gotta have this thing solved asap. Tongue
#7

[eluser]cahva[/eluser]
Terve Smile Seems good to me. Try a little debug:
Code:
function create($projekti_id)
{
    echo $projekti_id;
    $this->output->enable_profiler(TRUE);
    return;
}
..and see what that gives you.




Theme © iAndrew 2016 - Forum software by © MyBB