3

In a concrete5 website, where is the best place to store global variables that you would like to access site-wide across templates and controllers etc.?

e.g. A specific external URL, a Facebook ID, some kind of version number, etc.

Simon East
  • 55,742
  • 17
  • 139
  • 133

1 Answers1

3

If you want to do this in code (as opposed to via the CMS), you can put this in application/config/app.php:

<?php
return [
    'FacebookAppId' => '1234',
];

And then in controllers/templates you can retrieve it via:

<?= Config::get('app.FacebookAppId') ?>
Simon East
  • 55,742
  • 17
  • 139
  • 133