{"id":348653,"date":"2022-08-25T04:18:09","date_gmt":"2022-08-25T04:18:09","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=348653"},"modified":"2022-08-25T04:18:17","modified_gmt":"2022-08-25T04:18:17","slug":"how-to-use-events-listeners-and-event-subscriber-in-symfony","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/how-to-use-events-listeners-and-event-subscriber-in-symfony\/","title":{"rendered":"How to use events listeners and Event Subscriber in Symfony"},"content":{"rendered":"\n<p>If something happens in general it can be said to be an <strong>Event<\/strong>. We use events in order to perform some tasks if an event occurs, these tasks can be achieved by using the followings:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Event Subscriber<\/li><li>Event Listeners<\/li><\/ol>\n\n\n\n<p><strong>Event Subscriber<\/strong> <strong>vs<\/strong> <strong>Event Listeners<\/strong><\/p>\n\n\n\n<p>They both serve the same purpose but have different implementations. Both trigger some functions in the specific time of processing data by Symfony. <\/p>\n\n\n\n<p>We can declare multiple functions inside an event subscriber and set the priorities of the functions in the order in which each function will be called but it can&#8217;t be achieved in event listeners, so internally Symfony also uses event subscriber over event listener.<\/p>\n\n\n\n<p><strong>Event Subscriber<\/strong><\/p>\n\n\n\n<p>It is declared as follows:<\/p>\n\n\n\n<p><\/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=\"\">\/\/ src\/EventSubscriber\/ExceptionSubscriber.php\nnamespace App\\EventSubscriber;\n\nuse Symfony\\Component\\EventDispatcher\\EventSubscriberInterface;\nuse Symfony\\Component\\HttpKernel\\Event\\ExceptionEvent;\nuse Symfony\\Component\\HttpKernel\\KernelEvents;\n\nclass ExceptionSubscriber implements EventSubscriberInterface\n{\n    public static function getSubscribedEvents()\n    {\n        return [\n            KernelEvents::EXCEPTION =&gt; [\n                ['handleException', 1],\n                ['notifyAdminUser', 2],\n            ],\n        ];\n    }\n\n    public function handleException(ExceptionEvent $event)\n    {\n        \/\/ ...\n    }\n\n    public function notifyAdminUser(ExceptionEvent $event)\n    {\n        \/\/ ...\n    }\n}<\/pre>\n\n\n\n<p>This event subscriber handles the kernel exceptions like when we do not define routes in our project then this subscriber will be called. Also, we need to register this subscriber in the <strong>config\/services.yml<\/strong> file.<\/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=\"\">App\\EventSubscriber\\ExceptionSubscriber:\n\ttags:\n\t    - {doctrine.event_subscriber, connection: default}<\/pre>\n\n\n\n<p class=\"has-background\" style=\"background-color:#b3f4cc\">The subscriber function with the high number set as priority will be called first and the subscriber function with the lower number set as priority will be called last.  Here the function <em>notifyAdminUser<\/em> will be called and then the function <em>handleException<\/em> will be called.<\/p>\n\n\n\n<p><strong>Event Listener<\/strong><\/p>\n\n\n\n<p>As explained above the event listener is used for the same reason. It is declared as follows:<\/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=\"\">\/\/ src\/EventListener\/ExceptionListener.php\nnamespace App\\EventListener;\n\nuse Symfony\\Component\\HttpFoundation\\Response;\nuse Symfony\\Component\\HttpKernel\\Event\\ExceptionEvent;\nuse Symfony\\Component\\HttpKernel\\Exception\\HttpExceptionInterface;\n\nclass ExceptionListener\n{\n    public function onKernelException(ExceptionEvent $event)\n    {\n        $exception = $event-&gt;getThrowable();\n        $message = sprintf(\n            'Getting following error: %s with code: %s',\n            $exception-&gt;getMessage(),\n            $exception-&gt;getCode()\n        );\n\n        \/\/ Customize your response object to display the exception details\n        $response = new Response();\n        $response-&gt;setContent($message);\n\n        \/\/ HttpExceptionInterface is a special type of exception that\n        \/\/ holds status code and header details\n        if ($exception instanceof HttpExceptionInterface) {\n            $response-&gt;setStatusCode($exception-&gt;getStatusCode());\n            $response-&gt;headers-&gt;replace($exception-&gt;getHeaders());\n        } else {\n            $response-&gt;setStatusCode(Response::HTTP_INTERNAL_SERVER_ERROR);\n        }\n\n        \/\/ sends the modified response object to the event\n        $event-&gt;setResponse($response);\n    }\n}<\/pre>\n\n\n\n<p>This listener will be called once a kernel exception occurs like calling a route that does not exist. In this case, this listener will be called to handle the exception. Also, we need to register this listener in the <strong>config\/services.yml file.<\/strong><\/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=\"\">services:\n    App\\EventListener\\ExceptionListener:\n        tags:\n            - { name: kernel.event_listener, event: kernel.exception }<\/pre>\n\n\n\n<p>Thanks for reading me. I hope this blog would help you with a better understanding of Symfony subscribers and listeners. Please share your reviews on this, which will support me to write more.<\/p>\n\n\n\n<p>Until next time. \ud83d\udc4b<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If something happens in general it can be said to be an Event. We use events in order to perform some tasks if an event occurs, these tasks can be achieved by using the followings: Event Subscriber Event Listeners Event Subscriber vs Event Listeners They both serve the same purpose but have different implementations. Both <a href=\"https:\/\/webkul.com\/blog\/how-to-use-events-listeners-and-event-subscriber-in-symfony\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":310,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[13007,13010,13008,13009,2710],"class_list":["post-348653","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-events","tag-kernel-exception-handling","tag-listener","tag-subscriber","tag-symfony"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to use events listeners and Event Subscriber in Symfony - Webkul Blog<\/title>\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\/how-to-use-events-listeners-and-event-subscriber-in-symfony\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to use events listeners and Event Subscriber in Symfony - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"If something happens in general it can be said to be an Event. We use events in order to perform some tasks if an event occurs, these tasks can be achieved by using the followings: Event Subscriber Event Listeners Event Subscriber vs Event Listeners They both serve the same purpose but have different implementations. Both [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/how-to-use-events-listeners-and-event-subscriber-in-symfony\/\" \/>\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=\"2022-08-25T04:18:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-08-25T04:18:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Kumar Saurabh\" \/>\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=\"Kumar Saurabh\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-events-listeners-and-event-subscriber-in-symfony\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-events-listeners-and-event-subscriber-in-symfony\/\"},\"author\":{\"name\":\"Kumar Saurabh\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/fe421d7e87019de3a91449143b4e8c0d\"},\"headline\":\"How to use events listeners and Event Subscriber in Symfony\",\"datePublished\":\"2022-08-25T04:18:09+00:00\",\"dateModified\":\"2022-08-25T04:18:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-events-listeners-and-event-subscriber-in-symfony\/\"},\"wordCount\":306,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"keywords\":[\"Events\",\"kernel exception handling\",\"listener\",\"subscriber\",\"symfony\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-use-events-listeners-and-event-subscriber-in-symfony\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-events-listeners-and-event-subscriber-in-symfony\/\",\"url\":\"https:\/\/webkul.com\/blog\/how-to-use-events-listeners-and-event-subscriber-in-symfony\/\",\"name\":\"How to use events listeners and Event Subscriber in Symfony - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"datePublished\":\"2022-08-25T04:18:09+00:00\",\"dateModified\":\"2022-08-25T04:18:17+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-events-listeners-and-event-subscriber-in-symfony\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-use-events-listeners-and-event-subscriber-in-symfony\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-events-listeners-and-event-subscriber-in-symfony\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to use events listeners and Event Subscriber in Symfony\"}]},{\"@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\/fe421d7e87019de3a91449143b4e8c0d\",\"name\":\"Kumar Saurabh\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/08f4ea2512da567b3fbff160be0eeb27680fc7c82f1f902c8a58bead5cf64b51?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\/08f4ea2512da567b3fbff160be0eeb27680fc7c82f1f902c8a58bead5cf64b51?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Kumar Saurabh\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/kumar-saurabh108\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to use events listeners and Event Subscriber in Symfony - Webkul Blog","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\/how-to-use-events-listeners-and-event-subscriber-in-symfony\/","og_locale":"en_US","og_type":"article","og_title":"How to use events listeners and Event Subscriber in Symfony - Webkul Blog","og_description":"If something happens in general it can be said to be an Event. We use events in order to perform some tasks if an event occurs, these tasks can be achieved by using the followings: Event Subscriber Event Listeners Event Subscriber vs Event Listeners They both serve the same purpose but have different implementations. Both [...]","og_url":"https:\/\/webkul.com\/blog\/how-to-use-events-listeners-and-event-subscriber-in-symfony\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2022-08-25T04:18:09+00:00","article_modified_time":"2022-08-25T04:18:17+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png","type":"image\/png"}],"author":"Kumar Saurabh","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Kumar Saurabh","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/how-to-use-events-listeners-and-event-subscriber-in-symfony\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-events-listeners-and-event-subscriber-in-symfony\/"},"author":{"name":"Kumar Saurabh","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/fe421d7e87019de3a91449143b4e8c0d"},"headline":"How to use events listeners and Event Subscriber in Symfony","datePublished":"2022-08-25T04:18:09+00:00","dateModified":"2022-08-25T04:18:17+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-events-listeners-and-event-subscriber-in-symfony\/"},"wordCount":306,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"keywords":["Events","kernel exception handling","listener","subscriber","symfony"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/how-to-use-events-listeners-and-event-subscriber-in-symfony\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/how-to-use-events-listeners-and-event-subscriber-in-symfony\/","url":"https:\/\/webkul.com\/blog\/how-to-use-events-listeners-and-event-subscriber-in-symfony\/","name":"How to use events listeners and Event Subscriber in Symfony - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"datePublished":"2022-08-25T04:18:09+00:00","dateModified":"2022-08-25T04:18:17+00:00","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-events-listeners-and-event-subscriber-in-symfony\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/how-to-use-events-listeners-and-event-subscriber-in-symfony\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/how-to-use-events-listeners-and-event-subscriber-in-symfony\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to use events listeners and Event Subscriber in Symfony"}]},{"@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\/fe421d7e87019de3a91449143b4e8c0d","name":"Kumar Saurabh","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/08f4ea2512da567b3fbff160be0eeb27680fc7c82f1f902c8a58bead5cf64b51?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\/08f4ea2512da567b3fbff160be0eeb27680fc7c82f1f902c8a58bead5cf64b51?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Kumar Saurabh"},"url":"https:\/\/webkul.com\/blog\/author\/kumar-saurabh108\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/348653","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\/310"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=348653"}],"version-history":[{"count":17,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/348653\/revisions"}],"predecessor-version":[{"id":349393,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/348653\/revisions\/349393"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=348653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=348653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=348653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}