0

I'm currently creating my own custom MVC framework in PHP that uses the MVC URL standard: example.com/{controller}/{action}/{id}

This works fine, however, one of my controllers called "books" does not need the action in the URL: example.com/{controller}/{id}

How can I parse index from URL routing to the id in php mvc?

Example: localhost/books/1 instead of localhost/books/index/1

but I still want to access the url localhost/games/puzzle/1

tereško
  • 58,060
  • 25
  • 98
  • 150
Leo
  • 59
  • 1
  • 9
  • wich framework ? – Cananau Cristian May 26 '18 at 07:32
  • How do you expect this to be answerable? Your question does not yield any hint if you wrote a custom router / dispatcher, or if segments are pre-split by a RewriteRule e.g. (There is no such thing as a "MVC standard" btw. That's not related to your question. At all.) – mario May 26 '18 at 08:06

0 Answers0