PHP Class Pommo_Json, poMMo

This file is part of poMMo (http://www.pommo.org) poMMo 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; either version 2, or any later version. poMMo 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 program; see the file docs/LICENSE. If not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
Afficher le fichier Open project: soonick/poMMo Class Usage Examples

Méthodes publiques

Свойство Type Description
$_failMsg
$_output
$_successMsg

Méthodes publiques

Méthode Description
__construct ( $toggleEscaping = true )
add ( $key, $value = false ) beware of key conflicts (especially when passing arrays)!
addErr ( $e )
addMsg ( $m )
encode ( $input ) * JSON Encoding Methods authored by Jack Sleight (below); ---------------------------------------------------------------------- Version 0.5 Copyright Jack Sleight - www.reallyshiny.com This script is licensed under the: Creative Commons Attribution-ShareAlike 2.5 License ----------------------------------------------------------------------
escape ( $string )
fail ( $msg = false )
get ( $key, $value, $parent = NULL )
is_assoc ( $array )
loop ( $input, $type )
prefix ( $prefix, &$msg ) NOTE; message is passed by reference (modified via this function).
serve ( $success = true ) return/output the JSON
setFailMsg ( $msg ) sets the default success/failure message
setSuccessMsg ( $msg )
success ( $msg = false )
type ( $key, $value )

Method Details

__construct() public méthode

public __construct ( $toggleEscaping = true )

add() public méthode

beware of key conflicts (especially when passing arrays)!
public add ( $key, $value = false )

addErr() public méthode

public addErr ( $e )

addMsg() public méthode

public addMsg ( $m )

encode() public méthode

* JSON Encoding Methods authored by Jack Sleight (below); ---------------------------------------------------------------------- Version 0.5 Copyright Jack Sleight - www.reallyshiny.com This script is licensed under the: Creative Commons Attribution-ShareAlike 2.5 License ----------------------------------------------------------------------
public encode ( $input )

escape() public méthode

public escape ( $string )

fail() public méthode

public fail ( $msg = false )

get() public méthode

public get ( $key, $value, $parent = NULL )

is_assoc() public méthode

public is_assoc ( $array )

loop() public méthode

public loop ( $input, $type )

prefix() public méthode

NOTE; message is passed by reference (modified via this function).
public prefix ( $prefix, &$msg )

serve() public méthode

return/output the JSON
public serve ( $success = true )

setFailMsg() public méthode

sets the default success/failure message
public setFailMsg ( $msg )

setSuccessMsg() public méthode

public setSuccessMsg ( $msg )

success() public méthode

public success ( $msg = false )

type() public méthode

public type ( $key, $value )

Property Details

$_failMsg public_oe property

public $_failMsg

$_output public_oe property

public $_output

$_successMsg public_oe property

public $_successMsg