public function __construct($options = [])
 {
     $options = Options::create(['templatePath' => '../templates', 'accepts' => ['text/html' => true]])->merge($options);
     parent::__construct($options);
     if (is_null($this['renderer'])) {
         throw new \Exception('Renderer not set yet!');
     }
     $this->renderer = new Thing($this['renderer']);
 }
Beispiel #2
0
 public function __construct($options = array())
 {
     $this->configureErrorHandler();
     // configure
     $mergedOptions = ['env' => isset($_SERVER['ENV']) ? $_SERVER['ENV'] : 'development', 'config.path' => '../config', 'date.timezone' => 'UTC', 'route.dispatcher' => 'simple', 'response.chunkSize' => 4096];
     $optionsPath = isset($options['config.path']) ? $options['config.path'] : $mergedOptions['config.path'];
     $mergedOptions = Options::create($mergedOptions, $mergedOptions['env'])->mergeFile($optionsPath . '/config.php')->merge($options)->toArray();
     parent::__construct($mergedOptions);
 }
 public function __construct(array $options = [])
 {
     $options = Options::create(['renderers' => [], 'matchingTypes' => ['application/x-www-form-urlencoded' => 'text/html', 'multipart/form-data' => 'text/html'], 'accepts' => []])->merge($options);
     // ->toArray();
     parent::__construct($options);
 }
 public function __construct($options = [])
 {
     $this->options = Options::create(['allowedMethods' => ['POST' => true, 'PUT' => true, 'DELETE' => true, 'PATCH' => true], 'parsers' => ['application/x-www-form-urlencoded' => [$this, 'formParser'], 'multipart/form-data' => [$this, 'formParser']]])->merge($options);
     $this->parsers = $this->options['parsers'];
 }
 public function __construct(array $options = [])
 {
     $options = Options::create([])->merge($options);
     parent::__construct($options);
 }