I'm looking to create an index page of example.com that shows a login form when an user first goes on the site. Then after logging in, example.com will show a main page of their content. What is the best practice of accomplishing this in Zend Framework?
Would it be?
//example.com
//if auth is false, show a login form
//else...
$auth = Zend_Auth::getInstance();
if($auth->hasIdentity()) $loggedIn = true;
//show "Hello World"
So basically like "if you are signed in, echo "Hello World", else show login form". I'm trying to limit the amount of if, else statements and was wondering if this was the only way to go.