【问题标题】:CodeIgniter 3 - IonAuth, controller and method instead of routeCodeIgniter 3 - IonAuth,控制器和方法而不是路由
【发布时间】:2015-11-08 00:24:04
【问题描述】:

我的应用有问题。 我有登录页面并设置了路线:

$route['logowanie'] = 'Back/index/Login';

但是当我在登录时出错时,我的地址设置为: mydomain.com/Back/index/Login 但我想继续我的路线 - mydomain.com/logowanie

问题出在哪里?我使用 IonAuth 库

【问题讨论】:

  • 如果你有 Back.php 那么你只需要获取登录视图的 index() 方法。
  • 您必须更改 IonAuth 的代码/方法中的代码。
  • logowanie.php 必须具有获取登录视图的 index.php。

标签: php codeigniter authentication ion-auth


【解决方案1】:

在你的控制器中 function login() 更改为:

//if the login was un-successful
//redirect them back to the login page
$this->session->set_flashdata('message', $this->ion_auth->errors());
redirect('logowanie', 'refresh');

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-04
    相关资源
    最近更新 更多