The Home Page
Monday, October 26, 2009
The home page is rendered by the index action handler of the index controller.
The IndexController class is stored in the file IndexController.php inside the application/controllers directory. The skeleton for the class code is as follows:
class IndexController extends Zend_Controller_Action { // Insert the action handlers here }
The index action handler is an empty function:
public function indexAction() { }
The functionality is contained within the view script:
<?php $this->tabPane( 'tabs', $this->render('index/index/welcome.phtml'), array('title' => 'Welcome') ); echo $this->tabContainer('tabs');
This makes use of a couple of view helpers supplied by the ZendX_JQuery module.
The ZendX_JQuery_View_Helper_TabPane helper is used to build up a set of tabs; here there is only one.
The ZendX_JQuery_View_Helper_TabContainer helper is used to render the tab container.
The helper also adds the necessary code to the header, in order to initiate the tab container on the page being loaded, in accordance with the usual jQuery usage.
The contents of the tab are container in a separate script file called welcome.phtml, which is located in the index sub-directory:
<h1>Welcome to the GM-RAM Website!</h1> <p> GM-RAM is a company whose business is software development and consultancy. </p> <p> Here you can find information <?php echo $this->navLink('about_page', 'about the company'); ?> and <?php echo $this->navLink('contact_page', 'how to contact us'); ?>. </p> <p> You can also find <?php echo $this->navLink('blogs_page', 'details of our blogs'); ?> and any projects we are working on. </p>
The script makes use of the Default_View_Helper_NavLink custom helper in order to render the navigation links. I shall look at the implementation of this in my next post.

Practical Web 2.0 Applications with PHP (Expert's Voice) by Quentin Zervaas
Beginning Databases with PostreSQL: From Expert to Professional 2nd Edition: From Novice to Professional by Neil Matthew, Richard Stones