dstjh46606
2013-11-02 13:37
浏览 54
已采纳

如何检查用户是否在Opencart中的自定义页面登录[关闭]

I have a custom page in Opencart. In this page I am using PHP and Javascript based text editor. Now I need to check if user is logged in so that some more options are displayed. I had searched on Google but I did't find anything.

图片转代码服务由CSDN问答提供 功能建议

我在Opencart中有一个自定义页面。 在这个页面中,我使用基于PHP和Javascript的文本编辑器。 现在我需要检查用户是否已登录,以便显示更多选项。 我在谷歌搜索过但我找不到任何东西。

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • doudoulb1234 2013-11-02 22:04
    已采纳

    In Your controller (of that custom page) You can do this:

    if($this->customer->isLogged()) {
        echo "Customer is logged in and his ID is " . $this->customer->isLogged();
    } else {
        echo "Customer is not logged in";
    }
    

    This assumes that the custom page is within frontend and by user You actually mean customer (this assumption was done just because in backend every user has to be logged in prior to display any page).

    点赞 打赏 评论

相关推荐 更多相似问题