Permalink
Browse files

return an instance not a string

  • Loading branch information...
1 parent 7ed4575 commit e20e1b2ab314ba10c24679d75dff110ff36e4961 @basz basz committed Sep 24, 2012
Showing with 3 additions and 6 deletions.
  1. +3 −6 library/Zend/Mvc/Controller/Plugin/AcceptedModel.php
View
9 library/Zend/Mvc/Controller/Plugin/AcceptedModel.php
@@ -12,10 +12,7 @@
use Zend\Http\Request;
use Zend\Mvc\Controller\Plugin\AbstractPlugin;
-use Zend\View\Model\JsonModel;
-use Zend\View\Model\FeedModel;
use Zend\View\Model\ModelInterface;
-use Zend\View\Model\ViewModel;
use Zend\Mvc\InjectApplicationEventInterface;
use Zend\Mvc\MvcEvent;
@@ -76,10 +73,10 @@ public function __invoke(array $matchAgainst = null, $returnMatchedAcceptTypeOnl
return $res;
}
- //@todo return actual instance, make sure to preserve \
$modelName = $res->matchedAgainst->params['_internalViewModel'];
-
- return str_replace('|', '\\', $modelName);
+ $modelName = str_replace('|', '\\', $modelName);
+
+ return new $modelName;
}
/**

0 comments on commit e20e1b2

Please sign in to comment.