Welcome Guest, Not a member yet? Register   Sign In
problems with navigation
#1

[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




Theme © iAndrew 2016 - Forum software by © MyBB