Login   Register  
PHP Classes
elePHPant
Icontem

File: examples/example02_boolParamFromURL.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/example02_boolParamFromURL.php  >  Download  
File: examples/example02_boolParamFromURL.php
Role: Example script
Content type: text/plain
Description: In this example we retrieve an bool param from the URL
Class: param
Validate and filter request values
Author: By
Last change:
Date: 4 years ago
Size: 676 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 retrieve an bool param from the URL:
 *  to see the result try something like http://localhost/examples/example02_boolParamFromURL.php?myBool=true
 */
 
    
require_once ('../param.php');
    
    
$myBool param::register(array(
        
'name' => 'myBool',
        
'type' => PARAM_TYPE_BOOL,
        
'defaultValue' => false
    
));
    echo 
"Result: ";
    
var_dump($myBool->value);

?>