Welcome Guest, Not a member yet? Register   Sign In
Using HTTP verbs in routes
#1

Hi all! I have a problem with HTTP verbs in routes.
My config
PHP Code:
$route['test']['POST'] = 'welcome/test'
My controller
PHP Code:
<?php
defined
('BASEPATH') OR exit('No direct script access allowed');

class 
Welcome extends CI_Controller {
    
    public function 
test()
    {
        
$this->load->helper('url');
        
log_message('info''Post value: '.$this->input->post('val'));
        
redirect('/');
    }

My logs
Code:
INFO - 2015-05-22 11:53:31 --> Config Class Initialized
INFO - 2015-05-22 11:53:31 --> Hooks Class Initialized
DEBUG - 2015-05-22 11:53:31 --> UTF-8 Support Enabled
INFO - 2015-05-22 11:53:31 --> Utf8 Class Initialized
INFO - 2015-05-22 11:53:31 --> URI Class Initialized
INFO - 2015-05-22 11:53:31 --> Router Class Initialized
INFO - 2015-05-22 11:53:31 --> Output Class Initialized
INFO - 2015-05-22 11:53:31 --> Security Class Initialized
DEBUG - 2015-05-22 11:53:31 --> Global POST, GET and COOKIE data sanitized
INFO - 2015-05-22 11:53:31 --> Input Class Initialized
INFO - 2015-05-22 11:53:31 --> Language Class Initialized
ERROR - 2015-05-22 11:53:31 --> 404 Page Not Found: Test/index

Why CI try to use Test/index Controller/method?

Where is my mistake?
Reply


Messages In This Thread
Using HTTP verbs in routes - by Sky - 05-22-2015, 03:09 AM
RE: Using HTTP verbs in routes - by Narf - 05-22-2015, 05:31 AM
RE: Using HTTP verbs in routes - by Sky - 05-22-2015, 11:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB