duanjihe5180 2014-09-23 16:22 采纳率: 100%
浏览 20
已采纳

CodeIgniter - 创建新页面,获取404消息

I am trying to create a new page that will bring up a form for them to enter a name for a group. It will then create the group and add them as a member to it. I have a similar sign up that I have copied and changed to fit the needs of this, but when I try to access it it gives me a 404 message.

I am accessing the controller (groups.php):

<?php

class Login extends CI_Controller {

function index() {
    $this->load->view('includes/header');
    $this->load->view('group_view');
    $this->load->view('includes/footer');

    $this->createGroup();
}
function createGroup() {
    $this->load->library('form_validation');

    // validation rules
    $this->form_validation->set_rules('name', 'Name', 'trim|required');

    if ($this->form_validation->run() == FALSE) { //didnt validate

        $this->load->view('includes/header');
        $this->load->view('group_view');
        $this->load->view('includes/footer');
    } else {
        $this->load->model('model_groups');

        if($query = $this->model_groups->createGroup()) {

            //$data['account_created'] = 'Your account has been created.<br/><br/>You may now sign in.';

            $this->load->view('includes/header');
            $this->load->view('home_view');
            $this->load->view('includes/footer');
        } else {
            $this->load->view('includes/header');
            $this->load->view('group_view');
            $this->load->view('includes/footer');
        }
    } 

}
}
?>

I can post the model and view if necessary but Im pretty sure the problem is in the controller as that is what I am trying to load. Please let me know as soon as possible what my problem is! Thanks guys!

  • 写回答

1条回答 默认 最新

  • du5407 2014-09-23 16:38
    关注

    You should change your class name Login to Group

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 根据以下文字信息,做EA模型图
  • ¥15 删除虚拟显示器驱动 删除所有 Xorg 配置文件 删除显示器缓存文件 重启系统 可是依旧无法退出虚拟显示器
  • ¥15 vscode程序一直报同样的错,如何解决?
  • ¥15 关于使用unity中遇到的问题
  • ¥15 开放世界如何写线性关卡的用例(类似原神)
  • ¥15 关于并联谐振电磁感应加热
  • ¥60 请查询全国几个煤炭大省近十年的煤炭铁路及公路的货物周转量
  • ¥15 请帮我看看我这道c语言题到底漏了哪种情况吧!
  • ¥60 关机时蓝屏并显示KMODE_EXCEPTION_NOT_HANDLED,怎么修?
  • ¥66 如何制作支付宝扫码跳转到发红包界面