fork download
  1. <?php
  2.  
  3. namespace Controllers;
  4.  
  5. use Silex\Application;
  6. use Symfony\Component\HttpFoundation\Request;
  7. use Symfony\Component\HttpFoundation\Response;
  8.  
  9.  
  10. class IndexController
  11. {
  12. public function index(Request $request, Application $app)
  13. {
  14. return new Response('Index page');
  15. }
  16.  
  17. public function viewAllProducts(Request $request, Application $app)
  18. {
  19. return new Response('All products');
  20. }
  21.  
  22. public function viewProduct(Request $request, Application $app, $id)
  23. {
  24. return new Response($id . 'producth with this number.');
  25. }
  26. }
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
Standard output is empty