title: How to get values from neon file in Nette?
body: <p>I have small application based on Nette framework.</p>
  
  <p>I've created <code>constants.neon</code> file and add it to container. There will be some data which should be available from presenters, models, forms etc.</p>
  
  <p>How can I access to values in <code>constants.neon</code>? </p>
  
  <p>I know that there is a method <code>(new \Nette\Neon\Neon())-&gt;decode([NEON_FILE_PATH])</code> but I don't think that this is the <code>right way</code>. I suspect that after using <code>addConfig(...)</code> in <code>bootstrap.php</code> all data from those config files should be available all over the system.</p>
  
  <pre><code>&lt;?php
  // bootstrap.php
  require __DIR__ . '/../vendor/autoload.php';
  
  $configurator = new Nette\Configurator;
  
  $configurator-&gt;setDebugMode(true); // enable for your remote IP
  $configurator-&gt;enableDebugger(__DIR__ . '/../log');
  
  $configurator-&gt;setTempDirectory(__DIR__ . '/../temp');
  
  $configurator-&gt;createRobotLoader()
      -&gt;addDirectory(__DIR__)
      -&gt;addDirectory(__DIR__ . '/../vendor/phpoffice/phpexcel')
      -&gt;register();
  
  $configurator-&gt;addConfig(__DIR__ . '/config/config.neon');
  $configurator-&gt;addConfig(__DIR__ . '/config/config.local.neon');
  $configurator-&gt;addConfig(__DIR__ . '/config/constants.neon');
  
  $container = $configurator-&gt;createContainer();
  
  return $container;
  </code></pre>
  
  <p>My <code>constants.neon</code> file:</p>
  
  <pre><code>constants:
    DP_OPT = 'DP'
    PP_OPT = 'PP'
    DV_OPT = 'DV'
    ZM_OPT = 'ZM'
    TP_OPT = 'TP'
  </code></pre>
  
  <p>Thanks</p>
  
  <p><strong>UPDATE #1</strong></p>
  
  <p>Figured out that I've used wrong format of <code>.neon</code> file.</p>
  
  <pre><code>constants:
    DP_OPT: DP
    PP_OPT: PP
    DV_OPT: DV
    ZM_OPT: ZM
    TP_OPT: TP
  </code></pre>