Browse | Submit New Snippet | Create Package

 

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).

Versions Of This Snippet::

Zach Cox
Snippet ID Download Version Date Posted Author Delete
1260.12006-06-12 15:48Zach Cox

Download a raw-text version of this code by clicking on "Download Version"

 


Latest Snippet Version: :0.1

<?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);
	}
}

?>
		

Submit a new version

You can submit a new version of this snippet if you have modified it and you feel it is appropriate to share with others..