I’m having a lot of trouble understanding how MVC works on PHP. On Java and Swing based programs, or with winforms in C#, my views fire events, to which the controllers or the presenters subscribe, and in response perform an action. However, PHP lacks events. I’d implement them a la java, but I can’t understand how to achieve MVC when I can’t fire a method as a response for a hyperlink click.
So far I’m checking for POST and GET variables at the start() method of my controllers, and responding in a specific way. For example, if $_POST isn’t set, display the user registration view. Otherwise, register the user with the POST variables.
I know there has to be a better way to do it, but I can’t find anything on the web explaining the view -> controller relationship on PHP.
How do you manage this?