The Slim Framework support forum has moved to http://discourse.slimframework.com. This Tender forum is no longer maintained or monitored.

How should I serve static files?

autorun's Avatar

autorun

20 May, 2015 08:07 PM

There no documentation on how should I serve static files.
I need folder directory examples.

  1. 1 Posted by Nishant on 17 Aug, 2015 09:28 AM

    Nishant's Avatar

    Waiting for this reply. cant fine anything over internet

  2. 2 Posted by Sid on 26 Aug, 2015 04:31 AM

    Sid's Avatar

    I'll take a stab at this....
    If home.php is a static file (i.e. no data being inserted), then place the home.php file in the templates directory and use the following route to home.php

    $app->get('/', function() use ($app) {
      $app->render('home.php');
    }

  3. 3 Posted by Nishant Kumar V... on 26 Aug, 2015 04:33 AM

    Nishant Kumar Verma's Avatar

    who is this?

    public file will be reference directely

    like http://yourdomain.com/css/style.cs

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac