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

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

报告相同问题?