CodeIgniter Forums
problems with navigation - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: problems with navigation (/showthread.php?tid=25963)



problems with navigation - El Forum - 01-02-2010

[eluser]_SC_[/eluser]
hi guys,
I'm a newbie of codeignitor (and even PHP..).
Anyway I have some troubles on navigation. I have:
in my navigation.php (view):
Code:
<?php
if (count($navlist)){
    echo " <ul> ";
    foreach ($navlist as $id => $name){
        echo " <li> ";
        echo anchor("welcome/cat/$id",$name);
        echo " </li> ";
    }
    echo " </ul> ";
}
?&gt;
who print in html (for a certain row):
Code:
<a href="welcome/cat/2">pantaloni</a>
The last number is the ID ,necessary at the cat function, in the welcome.php (my controller):
Code:
class Welcome extends Controller {
    function Welcome()
    {
        parent::Controller();
    }
    function index(){
        ...
    }
    function cat($id){
        ...
        $data['category'] = $cat;
        $data['main'] = 'category';
        $this-> load-> vars($data);
        $this-> load-> view('template');
                ...
    }    
}

I created my category.php view but when I try to navigate by clicking on my link I get this server error:

Not Found
The requested URL /shoppingProva/welcome/cat/1 was not found on this server.


I seem to be unable to achieve the function cat () ..
any suggestions?
ty