PHP Класс 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.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$_failMsg
$_output
$_successMsg

Открытые методы

Метод Описание
__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 )

Описание методов

__construct() публичный Метод

public __construct ( $toggleEscaping = true )

add() публичный Метод

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

addErr() публичный Метод

public addErr ( $e )

addMsg() публичный Метод

public addMsg ( $m )

encode() публичный Метод

* 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 escape ( $string )

fail() публичный Метод

public fail ( $msg = false )

get() публичный Метод

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

is_assoc() публичный Метод

public is_assoc ( $array )

loop() публичный Метод

public loop ( $input, $type )

prefix() публичный Метод

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

serve() публичный Метод

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

setFailMsg() публичный Метод

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

setSuccessMsg() публичный Метод

public setSuccessMsg ( $msg )

success() публичный Метод

public success ( $msg = false )

type() публичный Метод

public type ( $key, $value )

Описание свойств

$_failMsg публичное свойство

public $_failMsg

$_output публичное свойство

public $_output

$_successMsg публичное свойство

public $_successMsg