{"id":523516,"date":"2026-01-28T10:05:10","date_gmt":"2026-01-28T10:05:10","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=523516"},"modified":"2026-01-28T10:13:20","modified_gmt":"2026-01-28T10:13:20","slug":"notifications-prestashop-symfony-controllers","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/","title":{"rendered":"Notifications in PrestaShop Symfony Controllers"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p>In PrestaShop Back Office module development, here we are learn how to show notifications in PrestaShop Symfony controllers.<\/p>\n\n\n\n<p>Validation errors are often handled by throwing PHP exceptions in Symfony based Controllers. <\/p>\n\n\n\n<p>While this approach works, it can interrupt the user experience and display unfriendly error pages.<\/p>\n\n\n\n<p>A better approach is to use <strong><a href=\"https:\/\/symfony.com\/doc\/current\/session.html#flash-messages\">Symfony Flash Messages<\/a><\/strong> to display validation like success, error, or other notifications (alerts) feedback directly in the Back Office interface. <\/p>\n\n\n\n<p>Flash messages allow you to show success, error, warning, and info messages without breaking the workflow.<\/p>\n\n\n\n<p>In this article, we will learn how to show notification messages in a PrestaShop Symfony controller (PrestaShop Back Office Symfony controllers) using flash messages instead of PHP exceptions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why Use Flash Messages Instead of Exceptions?<\/h2>\n\n\n\n<p>Using flash messages offers several advantages:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Improves user experience<\/li>\n\n\n\n<li>Prevents application crashes<\/li>\n\n\n\n<li>Keeps users on the same page<\/li>\n\n\n\n<li>Displays messages in a consistent UI format<\/li>\n\n\n\n<li>Works well with PrestaShop\u2019s Symfony-based Back Office<\/li>\n<\/ul>\n\n\n\n<p>Instead of stopping execution with an exception, we gently notify users about issues and guide them to fix them.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Use Case Example<\/h2>\n\n\n\n<p>In this tutorial, we will validate whether a product reference number already exists while saving a product in the Back Office.<\/p>\n\n\n\n<p>If the reference is duplicated, we will:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Prevent the save<\/li>\n\n\n\n<li>Display an error message<\/li>\n\n\n\n<li>Redirect the user back to the product edit page<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Register a Hook<\/h2>\n\n\n\n<p>PrestaShop provides hooks to interact with the Back Office form handling process.<\/p>\n\n\n\n<p>We use:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">actionBeforeUpdateProductFormHandler\n<\/pre>\n\n\n\n<p>This hook is triggered before the product form is saved.<\/p>\n\n\n\n<p>Make sure it is registered in your module\u2019s <code>install()<\/code> method:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$this-&gt;registerHook('actionBeforeUpdateProductFormHandler');\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2: Create the Validation Method<\/h2>\n\n\n\n<p>Now, create a helper method to check if the reference already exists.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public static function isReferenceExist($reference, $productId)\n{\n    $sql = new DbQuery();\n\n    $sql-&gt;select('id_product')\n        -&gt;from('product')\n        -&gt;where('reference = \"' . pSQL($reference) . '\"')\n        -&gt;where('id_product != ' . (int) $productId);\n\n    return (bool) Db::getInstance()-&gt;getValue($sql);\n}\n<\/pre>\n\n\n\n<p>This method checks if another product already uses the same reference.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3: Implement the Hook Method<\/h2>\n\n\n\n<p>Create the following method inside your module class:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public function hookActionBeforeUpdateProductFormHandler($params)\n{\n    $idProduct = (int) Tools::getValue('id_product');\n    $reference = $params['form_data']['details']['references']['reference'] ?? '';\n\n    if (!$reference || !$this-&gt;isReferenceExist($reference, $idProduct)) {\n        return;\n    }\n\n    \/\/ Get session\n    $container = PrestaShop\\PrestaShop\\Adapter\\SymfonyContainer::getInstance();\n\n    \/\/ Get session (PS &lt; 9 \/ PS &gt;= 9 compatible)\n    $session = version_compare(_PS_VERSION_, '9.0.0', '&gt;=')\n        ? $container-&gt;get('request_stack')-&gt;getSession()\n        : $container-&gt;get('session');\n\n    \/\/ Add flash error\n    $session-&gt;getFlashBag()-&gt;add(\n        'error',\n        $this-&gt;l('Reference number is duplicate')\n    );\n\n    \/\/ Redirect\n    Tools::redirectAdmin(\n        $this-&gt;context-&gt;link-&gt;getAdminLink('AdminProducts', true, [\n            'id_product' =&gt; $idProduct,\n            'updateproduct' =&gt; 1,\n        ])\n    );\n}\n<\/pre>\n\n\n\n<p>You can check the image for the references.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"509\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2026\/01\/screenshot1769179834828-1200x509.webp\" alt=\"Show Validation in PrestaShop Symfony Controllers\" class=\"wp-image-523531\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2026\/01\/screenshot1769179834828-1200x509.webp 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2026\/01\/screenshot1769179834828-300x127.webp 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2026\/01\/screenshot1769179834828-250x106.webp 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2026\/01\/screenshot1769179834828-768x326.webp 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2026\/01\/screenshot1769179834828.webp 1277w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><figcaption class=\"wp-element-caption\">Show Validation in PrestaShop Symfony Controllers<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4: Understanding Flash Messages<\/h2>\n\n\n\n<p>Symfony flash messages are stored in the session and displayed on the next request.<\/p>\n\n\n\n<p>PrestaShop automatically renders them in the Back Office.<\/p>\n\n\n\n<p>You can add different types:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$session-&gt;getFlashBag()-&gt;add('success', 'Saved successfully');\n$session-&gt;getFlashBag()-&gt;add('error', 'Something went wrong');\n$session-&gt;getFlashBag()-&gt;add('warning', 'This action may have side effects');\n$session-&gt;getFlashBag()-&gt;add('info', 'Changes will apply after cache clear');\n<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"514\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2026\/01\/screenshot1769179983080-1200x514.webp\" alt=\"flag types\" class=\"wp-image-523533\" style=\"aspect-ratio:2.334727288904707\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2026\/01\/screenshot1769179983080-1200x514.webp 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2026\/01\/screenshot1769179983080-300x128.webp 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2026\/01\/screenshot1769179983080-250x107.webp 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2026\/01\/screenshot1769179983080-768x329.webp 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2026\/01\/screenshot1769179983080.webp 1289w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><figcaption class=\"wp-element-caption\">Types of flash messages<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Step 5: Redirecting After Validation<\/h2>\n\n\n\n<p>After adding flash messages, you must redirect the user back to the edit page:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Tools::redirectAdmin($redirectUrl);\n<\/pre>\n\n\n\n<p>This is important because flash messages appear only after a redirect.<\/p>\n\n\n\n<p>Without redirection, the system may not display messages correctly<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How It Works Internally<\/h2>\n\n\n\n<p>Here\u2019s what happens behind the scenes:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>User submits the product form<\/li>\n\n\n\n<li>Hook is triggered<\/li>\n\n\n\n<li>The module validates the reference<\/li>\n\n\n\n<li>The system detects an error<\/li>\n\n\n\n<li>The module stores the message in the session<\/li>\n\n\n\n<li>The system redirects the user<\/li>\n\n\n\n<li>PrestaShop displays the message<\/li>\n<\/ol>\n\n\n\n<p>This creates a smooth validation flow without exceptions. It aligns with PrestaShop\u2019s modern architecture and best practices.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>Handling validation errors using flash messages in PrestaShop Back Office is a modern and user-friendly approach.<\/p>\n\n\n\n<p>Instead of breaking the workflow with PHP exceptions, you can:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Store messages in the Symfony session<\/li>\n\n\n\n<li>Redirect users gracefully<\/li>\n\n\n\n<li>Display clean UI notifications<\/li>\n<\/ul>\n\n\n\n<p>This improves both usability and maintainability of your modules.<\/p>\n\n\n\n<p>That\u2019s all about this blog. Hope it will help you.<\/p>\n\n\n\n<p>If you are facing any issues or have any doubts about the above process, please feel free to contact us through the comment section.<\/p>\n\n\n\n<p>Also, you can explore our&nbsp;<a href=\"https:\/\/webkul.com\/prestashop-development\/\">Prestashop Development Services<\/a>&nbsp;and a large range of quality&nbsp;<a href=\"https:\/\/store.webkul.com\/PrestaShop-Extensions.html\">Prestashop Modules<\/a>.<\/p>\n\n\n\n<p>For any doubt, contact us at&nbsp;support@webkul.com<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In PrestaShop Back Office module development, here we are learn how to show notifications in PrestaShop Symfony controllers. Validation errors are often handled by throwing PHP exceptions in Symfony based Controllers. While this approach works, it can interrupt the user experience and display unfriendly error pages. A better approach is to use Symfony Flash <a href=\"https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":743,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[209],"tags":[2065,9180],"class_list":["post-523516","post","type-post","status-publish","format-standard","hentry","category-prestashop","tag-prestashop","tag-prestashop-software"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Notifications in PrestaShop Symfony Controllers - Webkul Blog<\/title>\n<meta name=\"description\" content=\"Learn how to display notifications in PrestaShop Symfony controllers using Symfony flash messages instead of PHP exceptions.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Notifications in PrestaShop Symfony Controllers - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"Learn how to display notifications in PrestaShop Symfony controllers using Symfony flash messages instead of PHP exceptions.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-28T10:05:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-28T10:13:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2026\/01\/screenshot1769179834828-1200x509.webp\" \/>\n<meta name=\"author\" content=\"Jain Arpit Ashok\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jain Arpit Ashok\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/\"},\"author\":{\"name\":\"Jain Arpit Ashok\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/8e0bc5938cce917e3a249c441fa7d167\"},\"headline\":\"Notifications in PrestaShop Symfony Controllers\",\"datePublished\":\"2026-01-28T10:05:10+00:00\",\"dateModified\":\"2026-01-28T10:13:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/\"},\"wordCount\":571,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2026\/01\/screenshot1769179834828-1200x509.webp\",\"keywords\":[\"prestashop\",\"prestashop (software)\"],\"articleSection\":[\"prestashop\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/\",\"url\":\"https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/\",\"name\":\"Notifications in PrestaShop Symfony Controllers - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2026\/01\/screenshot1769179834828-1200x509.webp\",\"datePublished\":\"2026-01-28T10:05:10+00:00\",\"dateModified\":\"2026-01-28T10:13:20+00:00\",\"description\":\"Learn how to display notifications in PrestaShop Symfony controllers using Symfony flash messages instead of PHP exceptions.\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2026\/01\/screenshot1769179834828.webp\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2026\/01\/screenshot1769179834828.webp\",\"width\":1277,\"height\":542,\"caption\":\"flagvalidation\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Notifications in PrestaShop Symfony Controllers\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/8e0bc5938cce917e3a249c441fa7d167\",\"name\":\"Jain Arpit Ashok\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/18ad1b72ac03dc5a1e26466b33f7db5191c4f7f08bd5800f393bbc45d7e85e0b?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/18ad1b72ac03dc5a1e26466b33f7db5191c4f7f08bd5800f393bbc45d7e85e0b?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Jain Arpit Ashok\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/jainarpitashok-presta366\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Notifications in PrestaShop Symfony Controllers - Webkul Blog","description":"Learn how to display notifications in PrestaShop Symfony controllers using Symfony flash messages instead of PHP exceptions.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/","og_locale":"en_US","og_type":"article","og_title":"Notifications in PrestaShop Symfony Controllers - Webkul Blog","og_description":"Learn how to display notifications in PrestaShop Symfony controllers using Symfony flash messages instead of PHP exceptions.","og_url":"https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2026-01-28T10:05:10+00:00","article_modified_time":"2026-01-28T10:13:20+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2026\/01\/screenshot1769179834828-1200x509.webp","type":"","width":"","height":""}],"author":"Jain Arpit Ashok","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Jain Arpit Ashok","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/"},"author":{"name":"Jain Arpit Ashok","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/8e0bc5938cce917e3a249c441fa7d167"},"headline":"Notifications in PrestaShop Symfony Controllers","datePublished":"2026-01-28T10:05:10+00:00","dateModified":"2026-01-28T10:13:20+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/"},"wordCount":571,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2026\/01\/screenshot1769179834828-1200x509.webp","keywords":["prestashop","prestashop (software)"],"articleSection":["prestashop"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/","url":"https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/","name":"Notifications in PrestaShop Symfony Controllers - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2026\/01\/screenshot1769179834828-1200x509.webp","datePublished":"2026-01-28T10:05:10+00:00","dateModified":"2026-01-28T10:13:20+00:00","description":"Learn how to display notifications in PrestaShop Symfony controllers using Symfony flash messages instead of PHP exceptions.","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2026\/01\/screenshot1769179834828.webp","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2026\/01\/screenshot1769179834828.webp","width":1277,"height":542,"caption":"flagvalidation"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/notifications-prestashop-symfony-controllers\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Notifications in PrestaShop Symfony Controllers"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/8e0bc5938cce917e3a249c441fa7d167","name":"Jain Arpit Ashok","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/18ad1b72ac03dc5a1e26466b33f7db5191c4f7f08bd5800f393bbc45d7e85e0b?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/18ad1b72ac03dc5a1e26466b33f7db5191c4f7f08bd5800f393bbc45d7e85e0b?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Jain Arpit Ashok"},"url":"https:\/\/webkul.com\/blog\/author\/jainarpitashok-presta366\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/523516","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/743"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=523516"}],"version-history":[{"count":21,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/523516\/revisions"}],"predecessor-version":[{"id":523921,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/523516\/revisions\/523921"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=523516"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=523516"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=523516"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}