Welcome Guest, Not a member yet? Register   Sign In
Controller errors since 2.0
#1

[eluser]inner[/eluser]
Hello,

Can't get to work my controller functions. Only index() works.. Here is my controller:

<?php

// skelbimai.php

if ( ! defined('BASEPATH')) exit(redirect(base_url()));

class Skelbimai extends CI_Controller {

function __construct()
{
parent::__construct();
}

function index()
{
$this->load->view('template');
}

function add()
{
echo 'add function test';
}

}


?>

And the routes.php:

$route['it-skelbimai'] = "skelbimai";

when i use url like that: http://localhost/it-skelbimai/ it works, but when i load url like that: http://localhost/it-skelbimai/add/ i get 404. What am i doing wrong? Thank you!
#2

[eluser]inner[/eluser]
I solved it, by changing routes.php file

Before:
$route[‘it-skelbimai’] = “skelbimai”;

After:
$route[‘skelbimai’] = “skelbimai”;

interesting..
#3

[eluser]Phil Sturgeon[/eluser]
Try using a different $config['uri_protocol'].




Theme © iAndrew 2016 - Forum software by © MyBB