views:

27

answers:

2

I'm familiarizing myself with Zend and I'm using Twitter as an example to understand how controllers work.

Twitter has different registration and login pages

https://twitter.com/login

https://twitter.com/signup

  • Would these be 2 different controllers?
  • Is there a way to make them 2 actions of the same controller while still have them directly at site/login and site/signup?
+1  A: 

This depends on the routing technique and/or rewrite rule used on twitter. login and signup could be in the same controller (user/login + user/signup) or compeletely separated.

Have a look at "the default router" to learn about routes. Basically they represent a generic way of pasring an URL into a controller/action scenario.

I'm not that familiar with Zend, but I think you could have login + signup in a single controller if you just write the correct route to handle both URLs.

halfdan
+1  A: 

You need routing in your Zend Application, in your case Static Route. With routing you can 'tell' where the URL points to.

Tim