File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -69,15 +69,12 @@ public function indexAction(int $page, string $_format): Response
6969 */
7070 public function postShowAction (Post $ post ): Response
7171 {
72- // Symfony provides a function called 'dump()' which is an improved version
73- // of the 'var_dump()' function. It's useful to quickly debug the contents
74- // of any variable, but it's not available in the 'prod' environment to
75- // prevent any leak of sensitive information.
76- // This function can be used both in PHP files and Twig templates. The only
77- // requirement is to have enabled the DebugBundle.
78- if ('dev ' === $ this ->getParameter ('kernel.environment ' )) {
79- dump ($ post , $ this ->getUser (), new \DateTime ());
80- }
72+ // Symfony's 'dump()' function is an improved version of PHP's 'var_dump()' but
73+ // it's not available in the 'prod' environment to prevent leaking sensitive information.
74+ // It can be used both in PHP files and Twig templates, but it requires to
75+ // have enabled the DebugBundle. Uncomment the following line to see it in action:
76+ //
77+ // dump($post, $this->getUser(), new \DateTime());
8178
8279 return $ this ->render ('blog/post_show.html.twig ' , ['post ' => $ post ]);
8380 }
You can’t perform that action at this time.
0 commit comments