Location: PHPKode > scripts > param > examples/example03_paramList.php
<?php
/**
 *  @package Param
 *  @author Domenico Pontari <hide@address.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());
?>
Return current item: param