-1

I am upgrading a project from Kohana 2 to Kohana 3.

In the Kohana 2 version, in the view file, it is written:

if ($this->uri->segment('page'))
{
    if ($this->uri->segment(5))
    {

In Kohana 3, I changed this to

if ($this->request->param('page'))
{
    if ($this->request->param('param5'))
    {

but it's giving the following error message.

ErrorException [ Fatal Error ]: Using $this when not in object context

How should I resolve this?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
json
  • 21
  • 5

1 Answers1

2

Use Request::current()->param();. Refer to Upgrading from 2.x for further details.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
biakaveron
  • 5,493
  • 1
  • 16
  • 20