added fallback view
simplifications
This commit is contained in:
parent
f019a16a5d
commit
ec32a70ec2
2 changed files with 3 additions and 5 deletions
|
@ -99,7 +99,7 @@ abstract class Entity {
|
|||
$invalidProperties = array_diff(array_keys($this->getProperties()), $this->getDefinition()->getValidProperties());
|
||||
|
||||
if (count($missingProperties) > 0) {
|
||||
throw new \Exception('Entity "' . $this->getType() . '" requires propert' . ((count($missingProperties) == 1) ? 'y' : 'ies') . ': "' . implode(', ', $missingProperties) . '"');
|
||||
throw new \Exception('Entity \'' . $this->getType() . '\' requires propert' . ((count($missingProperties) == 1) ? 'y' : 'ies') . ": '" . implode(', ', $missingProperties) . "'");
|
||||
}
|
||||
|
||||
if (count($invalidProperties) > 0) {
|
||||
|
|
|
@ -118,6 +118,8 @@ class Router {
|
|||
$this->operation = self::getOperation($request);
|
||||
|
||||
if (empty(self::$viewMapping[$this->format])) {
|
||||
$this->view = new View\JSON($request, $response); // fallback view
|
||||
|
||||
if (empty($this->format)) {
|
||||
throw new \Exception('Missing format');
|
||||
}
|
||||
|
@ -128,10 +130,6 @@ class Router {
|
|||
|
||||
$class = self::$viewMapping[$this->format];
|
||||
$this->view = new $class($request, $response, $this->format);
|
||||
|
||||
// some general debugging information
|
||||
//Util\Debug::log('_SERVER', $_SERVER);
|
||||
//Util\Debug::log('PATH_INFO', $this->pathInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue