Welcome Guest, Not a member yet? Register   Sign In
organizing controllers into subfolders + associating a controller function with a rule group
#1

[eluser]Unknown[/eluser]
I don't know if this is intentional but the example is self explaning.

I organized my controllers into subfolders as the example here:
http://ellislab.com/codeigniter/user-gui...subfolders

And saved the rule group as explained here:
http://ellislab.com/codeigniter/user-gui...ngtoconfig

http://localhost/index.php/signin/html/index

File : /controllers/signin/html.php
Code:
<?php
class Html extends Controller
{
    public function index()
    {
        $this->load->library('form_validation');

        // expected to use $config['signin/html/index']
        // but it uses $config['html/index']
        //$valid = $this->form_validation->run();

        // then I have to specify the rule group manually
        $valid = $this->form_validation->run('signin/html/index');

        if ($valid)
        {
            $this->session->set_userdata('is_logged', TRUE);

            redirect('main/html/index');
        }
        else
        {
            $this->load->view('signin/html/index');
        }
    }

    // ...
}
?>




Theme © iAndrew 2016 - Forum software by © MyBB