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