Beispiel #1
0
 private function renderView($out)
 {
     $viewAnotation = $this->rAnotations->get('view');
     $viewAnotation = $viewAnotation[0];
     $tplName = $viewAnotation['args'][0];
     $view = $this->container->getView();
     return $view->getTwig($this->parser->getClassFullName())->render($tplName, $out);
 }
Beispiel #2
0
 public function testRequestWithParameters()
 {
     $request = Request::create('/foo/var.json', 'GET', array('name' => 'Gonzalo', 'surname' => 'Ayuso'));
     $parser = new Parser($request, 'Gonzalo');
     $this->assertEquals('Gonzalo\\Foo', $parser->getNamespace());
     $this->assertEquals('Gonzalo\\Foo\\Var', $parser->getClassFullName());
     $this->assertEquals('Gonzalo', $parser->getParameter('name'));
     $this->assertEquals('Ayuso', $parser->getParameter('surname'));
     $this->assertEquals('xxx', $parser->getParameter('noParameter', 'xxx'));
 }
Beispiel #3
0
 private function getContainerFromParser(Parser $parser)
 {
     $container = new Container($parser->getRequest());
     $container['parser'] = function () use($parser) {
         return $parser;
     };
     return $container;
 }