Welcome Guest, Not a member yet? Register   Sign In
Dynamic Menu - getting 404 when trying to navegate.
#1

[eluser]MEM[/eluser]
Newbie trying to build a dynamic menu with CI :


On my view v_header,I'm getting the links with url and category name.:

Code:
<?php
echo "<ul>";
foreach ($listacategorias as $categoria)
{
   echo "<li>";
   echo anchor("c_categoria/$categoria->id_cat",$categoria->nome_cat);
   echo "</li>";
}
echo "</ul>";

This works. Nice.
It will give me something like:
http://site.com/c_categoria/1
http://site.com/c_categoria/2
http://site.com/c_categoria/3

The issue is that, when I click on those links I get a 404 error.

Please help me out:

In my controller c_categoria, I'm having the following:
Code:
function cat($id)
{
    $cat = $this->M_Categoria->getCategoria($id);
                
    $data['titulo'] = "As nossas soluções para ".$cat->nome_cat;
    $data['listacategorias'] = $this->M_Categoria->getCategoriasPrincipais();
        
    $data['categoria'] = $cat;
        
    //o homepage_tpl should get this value:    
    $data['main'] = 'v_categoria';
        
        
    $this->load->vars($data);
    $this->load->view('homepage_tpl');
        
}



My template homepage_tpl, grab the array key main as $main, here:
Code:
<div id="container">
        
&lt;?php $this->load->view('v_header'); ?&gt;
            
&lt;?php $this->load->view($main); ?&gt;
    
&lt;?php $this->load->view('v_footer'); ?&gt;
    
</div>





Can anyone help me out on debugging this, and understand why I'm I getting a 404 ?

Sad
Márcio


Ps- on the controller I have also tried like this:
$cat = $this->M_Categoria->getCategoria($this->uri->segment(3));

No luck. Same 404 as ever.


Messages In This Thread
Dynamic Menu - getting 404 when trying to navegate. - by El Forum - 08-29-2009, 07:44 PM
Dynamic Menu - getting 404 when trying to navegate. - by El Forum - 08-29-2009, 08:27 PM
Dynamic Menu - getting 404 when trying to navegate. - by El Forum - 08-29-2009, 08:41 PM
Dynamic Menu - getting 404 when trying to navegate. - by El Forum - 08-29-2009, 09:17 PM
Dynamic Menu - getting 404 when trying to navegate. - by El Forum - 08-31-2009, 10:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB