Liz Liz - 1 year ago 100
PHP Question

how to link back to index.php in the fat free framework

I have created some routes with associated html links and they all work fine, except the homepage route (link).

So when i press on the home link to go back to index.php, it does not work.

I have already tried using a slash as key in my array, but that takes me too far back.

What can i put in the array so it links back to index.php?

here is the code in index.php


$f3->set('AUTOLOAD', 'model/');


$f3->route('GET /', 'content->home');

$f3->route('GET /about','content->about');

$f3->route('GET /jobs','content->jobs');



here is the code in my template header.htm

<repeat group="{{ @menu }}" key="{{ @key }}" value="{{ @link }}">
<a href="{{@key}}" {{ @[email protected]?' class="active" ':' ' }} >{{ @link }}</a>

Liz Liz
Answer Source

After taking a good look at the fat free framework documentation i found this:


This is a ff global that gets you back to index.php

I've saved it in my own variable like so:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download