0
votes

I want to setup my route so that url like word/startswith?prefix=ab maps to following code

class Controller_Word extends Controller_Mytemplate {
    public function action_startswith($fragment){
     /// Here $fragment should get "ab" value.
    }
}

Also could anyone tell me how can I get GET data in Kohana 3.2 controller? For the above scenario I can solve it by,

class Controller_Word extends Controller_Mytemplate {
    public function action_startswith($fragment=null){
        if($fragment==null){
            /// set $fragment to $_GET['prefix'] but in Kohana way.
        }
    }
}
1
No answer! or even a comment! :( - Shiplu Mokaddim

1 Answers

2
votes

Why don't you just use $this->request->query('prefix') ?

http://kohanaframework.org/3.2/guide/api/Request#query