ForwardFW
[ class tree: ForwardFW ] [ index: ForwardFW ] [ all elements ]

Source for file Controller.php

Documentation is available at Controller.php

  1. <?php
  2. declare(encoding "utf-8");
  3. /**
  4.  * This file is part of ForwardFW a web application framework.
  5.  *
  6.  * This library is free software; you can redistribute it and/or
  7.  * modify it under the terms of the GNU General Public
  8.  * License as published by the Free Software Foundation; either
  9.  * version 2.1 of the License, or (at your option) any later version.
  10.  *
  11.  * This library is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.  * General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public
  17.  * License along with this library; if not, write to the Free Software
  18.  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  19.  *
  20.  * PHP version 5
  21.  *
  22.  * @category   Controller
  23.  * @package    ForwardFW
  24.  * @subpackage Main
  25.  * @author     Alexander Opitz <opitz.alexander@primacom.net>
  26.  * @copyright  2009,2010 The Authors
  27.  * @license    http://www.gnu.org/copyleft/gpl.html GNU General Public License
  28.  * @version    SVN: $Id: $
  29.  * @link       http://forwardfw.sourceforge.net
  30.  * @since      File available since Release 0.0.1
  31.  */
  32.  
  33. /**
  34.  *
  35.  */
  36. require_once 'ForwardFW/Interface/Application.php';
  37.  
  38. /**
  39.  * This class holds basic functions for controllers.
  40.  *
  41.  * @category   Controller
  42.  * @package    ForwardFW
  43.  * @subpackage Main
  44.  * @author     Alexander Opitz <opitz.alexander@primacom.net>
  45.  * @license    http://www.gnu.org/copyleft/gpl.html GNU General Public License
  46.  * @link       http://forwardfw.sourceforge.net
  47.  */
  48. {
  49.     /**
  50.      * The application object.
  51.      *
  52.      * @var ForwardFW_Interface_Application 
  53.      */
  54.     protected $application;
  55.  
  56.     /**
  57.      * Constructor
  58.      *
  59.      * @param ForwardFW_Interface_Application $application The running application.
  60.      *
  61.      * @return void 
  62.      */
  63.     public function __construct(ForwardFW_Interface_Application $application)
  64.     {
  65.         $this->application = $application;
  66.     }
  67.  
  68.     /**
  69.      * Returns content of the given parameter for this class.
  70.      *
  71.      * @param string $strParameterName Name of parameter.
  72.      *
  73.      * @return mixed 
  74.      */
  75.     function getParameter($strParameterName)
  76.     {
  77.         return $this->application->getRequest()->getParameter(
  78.             $strParameterName,
  79.             get_class($this),
  80.             $this->application->getName()
  81.         );
  82.     }
  83.  
  84.     /**
  85.      * Returns configuration of the given parameter for this class.
  86.      *
  87.      * @param string $strParameterName Name of parameter.
  88.      *
  89.      * @return mixed 
  90.      */
  91.     function getConfigParameter($strParameterName)
  92.     {
  93.         return $this->application->getRequest()->getConfigParameter(
  94.             $strParameterName,
  95.             get_class($this),
  96.             $this->application->getName()
  97.         );
  98.     }
  99. }

Documentation generated on Sun, 30 Jan 2011 20:46:39 +0100 by phpDocumentor 1.4.3