Skip to content
This repository
Browse code

return an instance not a string

  • Loading branch information...
commit e20e1b2ab314ba10c24679d75dff110ff36e4961 1 parent 7ed4575
Bas Kamer authored September 25, 2012
9  library/Zend/Mvc/Controller/Plugin/AcceptedModel.php
@@ -12,10 +12,7 @@
12 12
 
13 13
 use Zend\Http\Request;
14 14
 use Zend\Mvc\Controller\Plugin\AbstractPlugin;
15  
-use Zend\View\Model\JsonModel;
16  
-use Zend\View\Model\FeedModel;
17 15
 use Zend\View\Model\ModelInterface;
18  
-use Zend\View\Model\ViewModel;
19 16
 use Zend\Mvc\InjectApplicationEventInterface;
20 17
 use Zend\Mvc\MvcEvent;
21 18
 
@@ -76,10 +73,10 @@ public function __invoke(array $matchAgainst = null, $returnMatchedAcceptTypeOnl
76 73
             return $res;
77 74
         }
78 75
 
79  
-        //@todo return actual instance, make sure to preserve \
80 76
         $modelName = $res->matchedAgainst->params['_internalViewModel'];
81  
-     
82  
-        return str_replace('|', '\\', $modelName);
  77
+        $modelName = str_replace('|', '\\', $modelName);
  78
+        
  79
+        return new $modelName;
83 80
     }
84 81
 
85 82
     /**

0 notes on commit e20e1b2

Please sign in to comment.
Something went wrong with that request. Please try again.