CodeIgniter Forums

Full Version: problems with navigation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

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):
if (count($navlist)){
    echo " <ul> ";
    foreach ($navlist as $id => $name){
        echo " <li> ";
        echo anchor("welcome/cat/$id",$name);
        echo " </li> ";
    echo " </ul> ";
who print in html (for a certain row):
<a href="welcome/cat/2">pantaloni</a>
The last number is the ID ,necessary at the cat function, in the welcome.php (my controller):
class Welcome extends Controller {
    function Welcome()
    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?