using Silex framework for the routing

Posted by Reshad on Stack Overflow See other posts from Stack Overflow or by Reshad
Published on 2012-11-12T16:48:36Z Indexed on 2012/11/12 16:59 UTC
Read the original article Hit count: 228

Filed under:
|
|

Hello everyone I would like to use the MicroFramework Silex to create the routing part of my website. The problem that I walk into is that I can't make it work since I don't really understand the documentation.

I have implemented the required files in my file tree and added some code into the index.php

this code is as follows:

$app = new Silex\Application(); 

$app->post('/web/{slug}', __DIR__.'/Controller/PostsController::showPost()');

$app->run();

I have also created a directory called Controller with the PostsController class in it. but now I don't know how to continue Can someone give me a simple example of how to create a dynamic routing that works with my Navigation class?

© Stack Overflow or respective owner

Related posts about php

Related posts about oop