Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationDI
      • ApplicationLatte
      • ApplicationTracy
      • CacheDI
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsDI
      • FormsLatte
      • Framework
      • HttpDI
      • HttpTracy
      • MailDI
      • ReflectionDI
      • SecurityDI
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Conventions
      • Drivers
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
      • Traits
    • Reflection
    • Security
    • Tokenizer
    • Utils
  • Tracy
    • Bridges
      • Nette
  • none

Classes

  • Decoder
  • Encoder
  • Entity
  • Neon

Exceptions

  • Exception
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Other releases
 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: 
Nette 2.4-20180918 API API documentation generated by ApiGen 2.8.0