Example #1
0
// Enable Nette Debugger for error visualisation & logging
$configurator->setDebugMode(['94.138.99.8', '10.0.2.2']);
$configurator->enableDebugger(__DIR__ . '/../log', '*****@*****.**');
// Specify folder for cache
$configurator->setTempDirectory(__DIR__ . '/../temp');
// Enable RobotLoader - this will load all classes automatically
$configurator->createRobotLoader()->addDirectory(__DIR__)->addDirectory(__DIR__ . '/../libs')->register();
// Create Dependency Injection container from config.neon file
$configurator->addConfig(__DIR__ . '/config/config.neon');
$configurator->addConfig(__DIR__ . '/config/config-local.neon');
$container = $configurator->createContainer();
//Form extensions
use Nette\Forms\Container;
use Nextras\Forms\Controls;
//Date & Datetime Picker
Container::extensionMethod('addDatePicker', function (Container $container, $name, $label = NULL) {
    return $container[$name] = new Controls\DatePicker($label);
});
Container::extensionMethod('addDateTimePicker', function (Container $container, $name, $label = NULL) {
    return $container[$name] = new Controls\DateTimePicker($label);
});
//Form Replication
Kdyby\Replicator\Container::register();
//File Uploading
MultipleFileUpload::register();
MultipleFileUpload::setQueuesModel(new MFUQueuesSQLite3());
//Thumbnails
$configurator->onCompile[] = function ($configurator, $compiler) {
    $compiler->addExtension('thumbnail', new Kollarovic\Thumbnail\DI\Extension());
};
return $container;