Closed hparadiz closed 6 years ago
file_put_contents('config.php', '<?php return ' . Nette\PhpGenerator\Helpers::dump($cfg) . ';');
Thank you @dg! This will be excellent for adding new configurations programatically.
Is there a way to preserve comments and order for existing code?
I'm looking to be able to build files that return directly.
This is a common way to configure things in various frameworks.
You can use a simple config getting function like so: