Source for file IndexController.php

Documentation is available at IndexController.php

  1. <?php
  2. /* -------------------------------------------------------------------------- */
  3. /* Module      : IndexController                                              */
  4. /*                                                                            */
  5. /* Version History :                                                          */
  6. /*                                                                            */
  7. /* Date        Vsn     Author          Description                            */
  8. /* -------------------------------------------------------------------------- */
  9. /* 19/01/09    1.0     S.Lindo         Initial version.                       */
  10. /* -------------------------------------------------------------------------- */
  11. /**
  12.  * Handles the actions for the basic website.
  13.  * 
  14.  * @package Default
  15.  */
  16. class IndexController extends Zend_Controller_Action 
  17. {
  18.     public function init(){
  19.         parent::init();
  20.         $this->view->controllerName $this->getRequest()->getControllerName();
  21.         $this->view->actionName $this->getRequest()->getActionName();
  22.     }
  23.  
  24.     /**
  25.      * The default action for all controllers.
  26.      *
  27.      * This displays the home page of the site.
  28.      *
  29.      * @return void 
  30.      */
  31.     public function indexAction(
  32.     {
  33.  
  34.         $this->_helper->layout->setLayout('website');
  35.         $this->view->pageTitle="Welcome";
  36.  
  37.         $session Session_Wrapper::getInstance();
  38.         $session->clearAll();
  39.     }
  40.  
  41.     /**
  42.      * Provides notes about this website and the skills used to create it.
  43.      *
  44.      * @return void 
  45.      */
  46.     public function aboutAction(
  47.     {
  48.  
  49.         $this->_helper->layout->setLayout('website');
  50.         $this->view->pageTitle="About this website";
  51.  
  52.     }
  53.  
  54.  
  55.  
  56.     /**
  57.      * Retrieves and displays all prices for each property
  58.      *
  59.      * @return void 
  60.      */
  61.     public function pricesAction(
  62.     {
  63.  
  64.         $this->_helper->layout->setLayout('website');
  65.         $this->view->pageTitle="Our Prices";
  66.  
  67.         $session Session_Wrapper::getInstance();
  68.         $client_id $session->get('client_id');
  69.  
  70.         // Get property and accommodation for this client
  71.         $clientProperty new ClientProperty();
  72.         $allclientProperty $clientProperty->getAll($client_id);
  73.         $this->view->accommodation Array();
  74.         foreach ($allclientProperty as $propertyArray => $property)
  75.         {
  76.             $this->view->accommodation[$property["accommodation"];
  77.         }
  78.     }
  79.  
  80.     /**
  81.      * Display the sitemap
  82.      *
  83.      * @return void 
  84.      */
  85.     public function sitemapAction(
  86.     {
  87.         $this->_helper->layout->setLayout('website');
  88.         $this->view->pageTitle="Site Map";
  89.     }
  90.  
  91.  
  92.     /**
  93.      * Arranges the images into an array ready for display.
  94.      *
  95.      * @return void 
  96.      */
  97.     public function galleryAction(
  98.     {
  99.         $this->_helper->layout->setLayout('website');
  100.         $this->view->pageTitle="Gallery";
  101.         $this->view->images=array();
  102.         $this->view->images["Hearth at Christmas.jpg";
  103.         $this->view->images["Lounge.jpg";
  104.         $this->view->images["Bedroom - four poster.jpg";
  105.         $this->view->images["Bedroom - with view.jpg";
  106.         $this->view->images["Bathroom 1.jpg";
  107.         $this->view->images["Bathroom 2.jpg";
  108.     }
  109. }

Documentation generated on Fri, 27 Mar 2009 13:48:36 +0000 by phpDocumentor 1.4.1