silex and the trailing slash

Wrong route definition:

Right route definition:

The .htaccess file:

 

Silex: routing to hostname

This is an example how to split your silex project by different hostnames.

Docs: http://silex.sensiolabs.org/api/Silex/Route.html#method_host

some Twig functions / helper

Template function to generate asset URLs

Usage like this:

And here is the Twig function:

Template function for reading session value with dot annotation

Access session values within the template like this:

And here is the Twig function:

 

Twig asset helper

This function generates an URL for project assets.

Usage:

Here are other solutions:

http://silex.sensiolabs.org/doc/cookbook/assets.html