Login   Register  
PHP Classes
elePHPant
Icontem

File: examples/example03_paramList.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Domenico Pontari  >  param  >  examples/example03_paramList.php  >  Download  
File: examples/example03_paramList.php
Role: Example script
Content type: text/plain
Description: In this example we use paramList and retrieve current minimized state
Class: param
Validate and filter request values
Author: By
Last change:
Date: 4 years ago
Size: 1,182 bytes
 

Contents

Class file image Download
<?php
/**
 *  @package Param
 *  @author Domenico Pontari <fairsayan@gmail.com>
 *  @copyright Copyright (c) 2009, Domenico Pontari
 *  @license http://opensource.org/licenses/bsd-license.php New and Simplified BSD licenses
 *  @version 1.0
 *
 *  In this example we use paramList and retrieve current minimized state
 *  You can using URL params to change firstParam and secondParam values
 *  (e.g. you can check maxLen for second param: http://localhost/examples/example03_paramList.php?secondParam=oversize)
 */
 
    
require_once ('../paramList.php');
    
    class 
myParamList extends paramList {
        function 
__construct () {
            
$this->set (array (
                array(
                    
'name' => 'firstParam',
                    
'defaultValue' => 7,
                    
'type' => PARAM_TYPE_INT
                
),array(
                    
'name' => 'secondParam',
                    
'defaultValue' => 'tryIt',
                    
'type' => PARAM_TYPE_STRING,
                    
'maxLen' => 5
                
)
            ));
        }
    }

    
$myParams = new myParamList();
    
var_dump($myParams->getState());
?>