panique / mini

Just an extremely simple naked PHP application, useful for small projects and quick prototypes. Some might call it a micro framework :)
1.35k stars 479 forks source link

Strip index method when it is present to its controller #177

Closed dvlden closed 9 years ago

dvlden commented 9 years ago

Let's say that controller is for Home and obviously it has a method of index().

If I type: http://mvc.dev/home/ It will load the actual index method as specified in "core/application"

Then if I type: http://mvc.dev/home/index It will load index method again, which is not the behaviour that I'd want.

How to modify this so that it strips index method if present, because index is always default if no method is present. Any way for this, because I am trying something with .htaccess and I'm failing.

panique commented 9 years ago

Sorry I dont understand the problem. home/index will load the index action in home controller, like in every other framework in the world too. Please go into detail what exactly the problem is.

dvlden commented 9 years ago

Never used any framework, because I just jumped into MVC pattern and I find that your MVC mini is very clean, straight-forward and easy to understand and learn from.

I will try to clarify things a bit...

I know it is normal that home/index will load index action, so as home without index specified. But I'd like to do something, so that if index as action is defined into url, get rid of it automatically (.htaccess I guess) because it is known that index is default action.

I just wonder what is the way to do it and is it possible to do it? Thank you in advance.

EDIT: Then that would cause issues with params. God damn it... Close this one please, I'm an idiot.