开发者

Using object in views in Kohana 3.0

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜