File indexing completed on 2024-12-22 05:33:23

0001 <?php
0002 
0003 /*
0004  *   GFX 4
0005  * 
0006  *   support: happy.snizzo@gmail.com
0007  *   website: http://gfx-framework.googlecode.com
0008  *   credits: Claudio Desideri
0009  *   
0010  *   This software is released under the MIT License.
0011  *   http://opensource.org/licenses/mit-license.php
0012  */ 
0013 
0014 /*
0015  * This class is intended to be extended for using as generic controller.
0016  */
0017 
0018 class EController {
0019   
0020   private $args;
0021   
0022   public function __construct(){
0023     $this->args = array();
0024   }
0025   
0026   public function set_args($args){
0027     $this->args = $args;
0028   }
0029   
0030   /*
0031    * Returns the args of the controller in position $p
0032    * if arg is not defined or empty, return false
0033    */
0034   public function arg_pos($p){
0035     $p -= 1;
0036     if(isset($this->args[$p]) and !empty($this->args[$p])){
0037       return $this->args[$p];
0038     } else {
0039       return false;
0040     }
0041   }
0042   
0043   /*
0044    * Check if the arg with name $n exists in the stacks
0045    */
0046   public function arg_key($p){
0047     if(in_array($p, $this->args)){
0048       return true;
0049     } else {
0050       return false;
0051     }
0052   }
0053 }
0054 
0055 ?>