Hello,
I have this code:
class MyController {
public function newUserAction()
{
$view = new View('myfrontend');
if($this->request->isPost())
{
$form = new MyForm;
$posts = $this->request->getPosts();
if($form->isValid($posts))
{
//...
}
}
$view->display();
}
}
So, everytime the form is not filled in correctly, the process starts again and so every time there is a "new View('myfrontend')" ect. But is that a good thing? To have a new view object again and again and again.
Ain't it better to work with singletons here?