1

For some reason, when I run this code, when adding an ID (the second block), my template doesn't seem to find my CSS/image files anymore.

But the code is exactly the same (apart from using an @id to request the parameter). Code framework that's been used is Fat-free framework.

This is my code:

$f3->route('GET /detail',
    function($f3, $params) {
        $test = new renderEngine;
        $test->detail($f3, $params['id']);
    }
);

$f3->route('GET /detail/@id',
    function($f3, $params) {
        $test = new renderEngine;
        $test->detail($f3, $params['id']);
    }
);

When checking in Chrome developer (or however you call the window) in the Sources tab I can see that in the first case it's:

>localhost
>
>--Audiodelight (name of my rootfolder)
>
>----css (with in that map my css files)

In the second case I get

>localhost
>
>--Audiodelight/detail (Which seems to be the problem)
>
>----css (with in that map my css files)

Does anyone have an idea why it's searching in a subdirectory? The directory it's looking for doesn't even exist.. Or know how to fix it?

Lonefish
  • 647
  • 2
  • 11
  • 32

1 Answers1

0

Check your routing syntax http://fatfreeframework.com/base#Routing

Are you getting any PHP errors from this?

  • I'm not getting any php errors, the page and data shows up as it should be. So it "works". But my references to other sources don't work anymore. For some reason it thinks that the index.php has moved to a directory that doesn't even exist, namely /Detail/ – Lonefish Aug 26 '15 at 15:28
  • What's your .htaccess look like? – Jon Lauters Aug 26 '15 at 15:30
  • I copied the file from f3, http://pastebin.com/BRnYenNJ But routing works for other pages? – Lonefish Aug 26 '15 at 15:34
  • Try removing the # from # RewriteBase / – Jon Lauters Aug 26 '15 at 15:36
  • Can't test it anymore since I just got off work.. Will try first thing tomorrow, thanks! – Lonefish Aug 26 '15 at 15:49
  • The problem was that I was linking them relatively, added {{@BASE}} in front of my linking and it works! Thanks anyway! – Lonefish Aug 27 '15 at 08:23