JsonComponent | |
| Type: Class |
Category: Other |
| License: GNU Library Public License |
Language: PHP |
| Description: Cake component that uses the JSON-PHP library (http://mike.teczno.com/json.html). | |
|
Download a raw-text version of this code by clicking on "Download Version"
<?php
class JsonComponent extends Object
{
var $json = null;
function startup(&$controller)
{
vendor('JSON');
$this->json =& new Services_JSON();
}
function encode($value)
{
return $this->json->encode($value);
}
function decode($input)
{
return $this->json->decode($input);
}
}
?>
You can submit a new version of this snippet if you have modified it and you feel it is appropriate to share with others..