[eluser]Unknown[/eluser]
Hi all.
First, I would like to introduce myself. I'm a programmer from Croatia. A little bit young, but been around for 3 years now. I have done some sites using CodeIgniter (my blog, a little company site) etc.
Now, to the problem. Yesterday I started a new project, and ... well, wanted to use CodeIgniter
I have created a small model called Template:
Code:
<?php
class Template extends Model {
public function Template() {
parent::Model();
}
public function insert($content,$title = 'undefined') {
$template_vars = array (
'sub_ => $title,
'design => base_().'design/',
'content' => $content
);
$this->load->view('template.php',$template_vars);
}
}
?>
(I autoload the model)
So that you can understand my problem, let's look at a simple controller:
Code:
<?php
class Start extends Controller {
public function Start() {
parent::Controller();
$this->_template();
}
public function _template() {
$content = $this->load->view('models/start.php','',true);
$this->template->insert($content,'start page');
}
}
?>
So the theory now

I've created files template.php, models/start.php .
When I access the url /index.php/start I get a 404 error.
I've renamed the function
_template() inside the controller to
template(), and when accessing the url /index.php/start/template, I get the contents of the models/start.php twice (because of the
template() function been called twice (inside the constructor and also manually)).
But, when accessing the url /index.php/start I get nothing..
Maybe it is a simple error, but I can't find it. Help
Sorry for my bad english