The question is already asked in stackoverflow. Now giving it here, in this
dead list.
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.
}
}
}
--
Shiplu.Mokadd.im
ImgSign.com | A dynamic signature machine
Innovation distinguishes between follower and leader
On Wed, Jan 4, 2012 at 4:31 PM, shiplu <shiplu.net@gmail.com> wrote: > The question is already asked in stackoverflow. Now giving it here, in this > dead list. Welcome to the Twilight Zone. > Also could anyone tell me how can I get GET data in Kohana 3.2 controller? $this->request->query() -- Woody Gilk http://about.me/shadowhand
On Thu, Jan 5, 2012 at 6:37 AM, Woody Gilk <woody.gilk@gmail.com> wrote: > $this->request->query() Ah, Who knew it would be 'query' ? I was hoping a method named 'get'. Thanks though. Any idea about the first part of the question? -- Shiplu.Mokadd.im ImgSign.com | A dynamic signature machine Innovation distinguishes between follower and leader
On Wed, Jan 4, 2012 at 6:41 PM, shiplu <shiplu.net@gmail.com> wrote: > Ah, Who knew it would be 'query' ? I was hoping a method named 'get'. > Thanks though. Any idea about the first part of the question? Kohana stopped supporting function parameters for actions in v3.2. -- Woody Gilk http://about.me/shadowhand
On Thu, Jan 5, 2012 at 8:55 AM, Woody Gilk <woody.gilk@gmail.com> wrote: > On Wed, Jan 4, 2012 at 6:41 PM, shiplu <shiplu.net@gmail.com> wrote: > > Ah, Who knew it would be 'query' ? I was hoping a method named 'get'. > > Thanks though. Any idea about the first part of the question? > > Kohana stopped supporting function parameters for actions in v3.2. > I see. So how do I get "ab" in controller if my url is like word/startswith/ab or even word/startswith/prefix/ab/ -- Shiplu.Mokadd.im ImgSign.com | A dynamic signature machine Innovation distinguishes between follower and leader
On Thu, Jan 5, 2012 at 5:19 AM, shiplu <shiplu.net@gmail.com> wrote: > > On Thu, Jan 5, 2012 at 8:55 AM, Woody Gilk <woody.gilk@gmail.com> wrote: >> >> Kohana stopped supporting function parameters for actions in v3.2. > > I see. So how do I get "ab" in controller if my url is like > word/startswith/ab or even word/startswith/prefix/ab/ > Use $this->request->param($name) instead. -- Woody Gilk http://about.me/shadowhand
i normally use Arr::get($_GET, "prefix"); -- Dave Carlson On Thursday, 5 January 2012 at 00:41, shiplu wrote: > > > On Thu, Jan 5, 2012 at 6:37 AM, Woody Gilk <woody.gilk@gmail.com (mailto:woody.gilk@gmail.com)> wrote: > > $this->request->query() > Ah, Who knew it would be 'query' ? I was hoping a method named 'get'. > Thanks though. Any idea about the first part of the question? > > -- > Shiplu.Mokadd.im (http://Shiplu.Mokadd.im) > ImgSign.com (http://ImgSign.com) | A dynamic signature machine > Innovation distinguishes between follower and leader >