public function testDefaultValues() { $config = new Config(); $this->assertNull($config->get('foo')); $this->assertNull($config->foo); $this->assertFalse($config->get('foo', false)); $this->assertEquals('bar', $config->get('foo', 'bar')); }
/** * @param \Exception $e */ public function onExceptionShowErrorPage(\Exception $e) { try { $errorUrl = sprintf("/%s/%s", $this->config->get('errors.controller', 'errors'), $this->config->get('errors.action', 'error')); $request = new HTTP\Request($errorUrl); $request->setParam('exception', $e); $this->webApp->dispatch($request); } catch (\Exception $e2) { $this->onExceptionAbort($e); } }
/** * @return \Hynage\ORM\EntityManager */ public function bootstrap() { $connection = new Connection($this->config->get('uri')); $dbPersister = new DatabasePersistence($connection); $em = new EntityManager(); $em->addPersister('database', $dbPersister); if ($this->config->has('entityNameFormatter')) { $em->setEntityNameFormatter($this->config->get('entityNameFormatter')); } if ($this->config->has('repositoryNameFormatter')) { $em->setRepositoryNameFormatter($this->config->get('repositoryNameFormatter')); } $this->em = $em; return $em; }
/** * @return \Hynage\MVC\Controller\Front */ public function bootstrap() { $front = new Front($this->application); $front->setController($this->config->get('defaults.controller', 'index'))->setAction($this->config->get('defaults.action', 'index')); return $front; }
/** * @param string $key * @return HtmlElement */ public function removeAttribute($key) { $this->_attributes->remove($key); return $this; }