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:
18: const CHAIN = '!!chain';
19:
20:
21: /**
22: * Returns the NEON representation of a value.
23: * @param mixed $var
24: * @param int $options
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 $input
37: * @return mixed
38: */
39: public static function decode($input)
40: {
41: $decoder = new Decoder;
42: return $decoder->decode($input);
43: }
44: }
45: