开发者

Using object in views in Kohana 3.0

开发者 https://www.devze.com 2023-03-31 02:49 出处:网络
I am upgrading a project from Kohana 2 to Kohana 3. In the Kohana 2 version, in the view file, it is written:

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-&g开发者_StackOverflow社区t;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?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号