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 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序