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