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.
Exibir arquivo
Open project: soonick/poMMo
Class Usage Examples
Public Properties
Public Methods
Method |
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 method
beware of key conflicts (especially when passing arrays)!
public add ( $key, $value = false ) |
* 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 fail ( $msg = false ) |
public get ( $key, $value, $parent = NULL ) |
public loop ( $input, $type ) |
NOTE; message is passed by reference (modified via this function).
public prefix ( $prefix, &$msg ) |
public serve ( $success = true ) |
setFailMsg()
public method
sets the default success/failure message
setSuccessMsg()
public method
public type ( $key, $value ) |
Property Details
$_failMsg public_oe property
$_output public_oe property
$_successMsg public_oe property