1: <?php
2:
3: /**
4: * This file is part of the Nette Framework (http://nette.org)
5: * Copyright (c) 2004 David Grudl (http://davidgrudl.com)
6: */
7:
8: namespace Nette\Neon;
9:
10: use Nette;
11:
12:
13: /**
14: * Simple parser & generator for Nette Object Notation.
15: *
16: * @author David Grudl
17: */
18: class Neon
19: {
20: const BLOCK = Encoder::BLOCK;
21: const CHAIN = '!!chain';
22:
23:
24: /**
25: * Returns the NEON representation of a value.
26: * @param mixed
27: * @param int
28: * @return string
29: */
30: public static function encode($var, $options = NULL)
31: {
32: $encoder = new Encoder;
33: return $encoder->encode($var, $options);
34: }
35:
36:
37: /**
38: * Decodes a NEON string.
39: * @param string
40: * @return mixed
41: */
42: public static function decode($input)
43: {
44: $decoder = new Decoder;
45: return $decoder->decode($input);
46: }
47:
48: }
49: