protected function __construct() { } final public static function getInstance() { if (null === static::$instance) { static::$instance = new static(); } return static::$instance; } final private function __clone() { } }
public function indexAction($name) { $widget = new Widget(); // do something with the widget... $errors = $this->get("validator")->validate($widget); return $this->render('HelloBundle:hello:index.html.twig', array( "errors" => $errors )); } }