[eluser]Ivan Augusto[/eluser]
Hi Guys... i having problems with routes again, following the data:
Code:
// controller/projetos/projetos.php
class Projetos extends Controller {
function Projetos() {
parent::Controller();
$this->load->helper('url');
$this->load->helper('form');
}
function index() {
$data['titulo'] = "Projetos";
$data['projetos'] = $this->db->get('projetos');
$this->load->view('projetos/projetos_view',$data);
}
}
// controller/projetos/planejamento/planejamento.php
class Planejamento extends Controller {
function Planejamento() {
parent::Controller();
$this->load->helper('url');
$this->load->helper('form');
}
function index() {
echo 'Planejamento';
}
function listagem($projeto_id = 0) {
$data['titulo'] = "Planejamentos";
$data['projeto_id'] = $projeto_id;
$this->load->view('projetos/planejamento/listagem_view',$data);
}
}
// views/projetos/projetos_view.php
<html>
<head>
<title><?=$titulo;?></title>
<body>
<table border="1" width="100%">
<thead>
<tr>
<th>Nome</th>
<th>Responsável</th>
<th>Tarefas</th>
<th>Previsto Para</th>
<th> </th>
</tr>
</thead>
<tbody>
<? foreach ($projetos->result() as $projeto): ?>
<tr>
<td><?=$projeto->nome; ?></td>
<td><?=$projeto->gerenteProjeto_id; ?></td>
<td>0</td>
<td>0</td>
<td>
<?=anchor('projetos/'.$projeto->id.'/planejamento','planejamento')?><br/
<?=anchor('projetos/'.$projeto->id.'/despesas/','despesas')?>
</td>
</tr>
<? endforeach; ?>
</tbody>
</table>
</body>
</html>
// view/projetos/planejamento/listagem_view.php
<html>
<head>
<title><?=$titulo;?></title>
<body>
<?=anchor('projetos/'.$projeto_id.'/planejamento/os/adicionar','Adicionar OS');?>
<br/><br/>
<table border="1" width="100%">
<thead>
<tr>
<th>Nome</th>
<th>Data Inicial</th>
<th>Data Final</th>
<th>Horas estimadas</th>
<th>Horas executadas</th>
</tr>
</thead>
</table>
</body>
</html>
// and routers:
$route['projetos'] = "projetos/projetos/index";
$route['projetos/(:num)/planejamento'] = 'projetos/planejamento/planejamento/listagem/$1';
but when I click on 'Planejamento' in view, the 404 error page show up!
Pleaseee... i suffering to fix...
Thks for attention ;]~