Welcome Guest, Not a member yet? Register   Sign In
Subdirectory Controller Problem
#1

[eluser]Kyle Wiebers[/eluser]
I'm building my first website with CodeIgniter and it's very easy so far. However I want to create a url like localhost/MU/events/rooms/roomname, where roomname changes with the room the user selects. I have a function rooms in the events controller that takes an argument, but when trying to access the main page, localhost/MU/events/rooms CI throws an error that I was missing an argument.

My code looks like this:
Code:
function rooms($room)
    {
        if(isset($room)) {
            switch($room) {
                case 'name':
                    $data['content'] = '<p>Room Name</p>';
                    break;
            }
        } else {
            $data['content'] = '<p>Test</p>';
        }
        $this->load->view('header');
        $this->load->view('masthead');
        $this->load->view('menu');
        $this->load->view('event-menu');
        $this->load->view('home-side');
        $this->load->view('content',$data);
        $this->load->view('footer');
        
    }

Is there anyway to eliminate the error on the page?


Messages In This Thread
Subdirectory Controller Problem - by El Forum - 11-14-2008, 08:27 PM
Subdirectory Controller Problem - by El Forum - 11-15-2008, 02:00 AM
Subdirectory Controller Problem - by El Forum - 11-15-2008, 11:46 AM
Subdirectory Controller Problem - by El Forum - 11-15-2008, 01:27 PM



Theme © iAndrew 2016 - Forum software by © MyBB