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:
22:
23: /**
24: * Returns the NEON representation of a value.
25: * @param mixed
26: * @param int
27: * @return string
28: */
29: public static function encode($var, $options = NULL)
30: {
31: $encoder = new Encoder;
32: return $encoder->encode($var, $options);
33: }
34:
35:
36: /**
37: * Decodes a NEON string.
38: * @param string
39: * @return mixed
40: */
41: public static function decode($input)
42: {
43: $decoder = new Decoder;
44: return $decoder->decode($input);
45: }
46:
47: }
48: