SimplOnPHP /SimplOn/Datas/PrintF.php

Language PHP Lines 52
MD5 Hash 636c6c6bfa52c3713e3965be3cde49a8
Repository git://github.com/SimplOnPHP/SimplOnPHP.git View Raw File View Project SPDX
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/*
	Copyright © 2011 Rubén Schaffer Levine and Luca Lauretta <http://simplonphp.org/>
	
	This file is part of “SimplOn PHP”.
	
	“SimplOn PHP” is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation version 3 of the License.
	
	“SimplOn PHP” is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.
	
	You should have received a copy of the GNU General Public License
	along with “SimplOn PHP”.  If not, see <http://www.gnu.org/licenses/>.
*/
namespace SimplOn\Datas;
/**
 * PrintF data type
 * 
 * This is a PrintF data type which allow you print a text with format.
 * 
 * @author Rubén Schaffer Levine and Luca Lauretta <http://simplonphp.org/>
 * @copyright (c) 2011, Rubén Schaffer Levine and Luca Lauretta
 * @category Data
 */

class PrintF extends ComplexData {
	/**
         * 
         * Function val - The function checks if the value is null,if it's returns showView.
         *  
         */	
    public function val($val=null){
        if(!isset($val)){
            return $this->showView();
        }
        
    }
        /**
         * 
         * Function showView - This function overwrite the original showView 
         * function to show an output with format.
         * 
         */    
	public function showView($fill = null){
            return vsprintf(array_shift($this->sources), $this->sources);
	}
}
Back to Top