{"id":111,"date":"2007-01-25T18:51:20","date_gmt":"2007-01-25T09:51:20","guid":{"rendered":"https:\/\/wp-78qb7hnp.pistolfly.jp\/weblog\/2007\/01\/retrieve-information-about-the.html"},"modified":"2016-03-24T13:45:27","modified_gmt":"2016-03-24T04:45:27","slug":"retrieve-information-about-the","status":"publish","type":"post","link":"https:\/\/www.pistolfly.com\/weblog\/2007\/01\/retrieve-information-about-the.html","title":{"rendered":"Retrieve information about the current route"},"content":{"rendered":"<p><a title=\"symfony PHP5 framework\" href=\"http:\/\/www.symfony-project.com\/book\/trunk\/routing\">symfony PHP5 framework<\/a><\/p>\n<blockquote><p>Retrieve information about the current route<br \/>\nIf you need to retrieve information about the current route, for instance to prepare a future 'back to page xxx' link, you should use the methods of the sfRouting object. For instance, if your routing.yml defines:<\/p>\n<pre>&lt;code&gt;\r\nmy_rule:\r\n  url:   \/call_my_rule\r\n  param: { module: mymodule, action: myaction }\r\n&lt;\/code&gt;<\/pre>\n<p>Use the following calls in the action:<\/p>\n<pre>&lt;code&gt;\r\n\/\/ if you require an URL like\r\nhttp:\/\/myapp.example.com\/call_my_rule\/param1\/xxx\/param2\/yyy\r\n \r\n$uri = sfRouting::getInstance()-&gt;getCurrentInternalUri();\r\n\/\/ will return 'mymodule\/myaction?param1=xxx&amp;param2=yyy'\r\n \r\n$uri = sfRouting::getInstance()-&gt;getCurrentInternalUri(true);\r\n\/\/ will return '@myrule?param1=xxx&amp;param2=yyy'\r\n \r\n$route = sfRouting::getInstance()-&gt;getCurrentRouteName();\r\n\/\/ will return 'myrule'\r\n&lt;\/code&gt;<\/pre>\n<p>The URIs returned by the ->getCurrentInternalUri() method can be used in a call to a link_to() helper.<br \/>\nIn addition, you might want to get the first or the last action called in a template. The following variables are automatically updated at each request and are available to templates:<br \/>\n$sf_first_action<br \/>\n$sf_first_module<br \/>\n$sf_last_action<br \/>\n$sf_last_module<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>symfony PHP5 framework Retrieve information about the current route If you need to retrieve information about  &hellip; <a href=\"https:\/\/www.pistolfly.com\/weblog\/2007\/01\/retrieve-information-about-the.html\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">Retrieve information about the current route<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"ja","_original_post":"111","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-111","post","type-post","status-publish","format-standard","hentry","category-symfony","ja"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Retrieve information about the current route - Pistolfly<\/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:\/\/www.pistolfly.com\/weblog\/2007\/01\/retrieve-information-about-the.html\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Retrieve information about the current route - Pistolfly\" \/>\n<meta property=\"og:description\" content=\"symfony PHP5 framework Retrieve information about the current route If you need to retrieve information about &hellip; \u7d9a\u304d\u3092\u8aad\u3080 Retrieve information about the current route &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pistolfly.com\/weblog\/2007\/01\/retrieve-information-about-the.html\" \/>\n<meta property=\"og:site_name\" content=\"Pistolfly\" \/>\n<meta property=\"article:published_time\" content=\"2007-01-25T09:51:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-03-24T04:45:27+00:00\" \/>\n<meta name=\"author\" content=\"Pistolfly\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"Pistolfly\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"1\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2007\\\/01\\\/retrieve-information-about-the.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2007\\\/01\\\/retrieve-information-about-the.html\"},\"author\":{\"name\":\"Pistolfly\",\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#\\\/schema\\\/person\\\/e779e918730b507907b3a35b77a9a2ab\"},\"headline\":\"Retrieve information about the current route\",\"datePublished\":\"2007-01-25T09:51:20+00:00\",\"dateModified\":\"2016-03-24T04:45:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2007\\\/01\\\/retrieve-information-about-the.html\"},\"wordCount\":121,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#\\\/schema\\\/person\\\/e779e918730b507907b3a35b77a9a2ab\"},\"articleSection\":[\"Symfony\"],\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2007\\\/01\\\/retrieve-information-about-the.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2007\\\/01\\\/retrieve-information-about-the.html\",\"url\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2007\\\/01\\\/retrieve-information-about-the.html\",\"name\":\"Retrieve information about the current route - Pistolfly\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#website\"},\"datePublished\":\"2007-01-25T09:51:20+00:00\",\"dateModified\":\"2016-03-24T04:45:27+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2007\\\/01\\\/retrieve-information-about-the.html#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2007\\\/01\\\/retrieve-information-about-the.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2007\\\/01\\\/retrieve-information-about-the.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u30db\u30fc\u30e0\",\"item\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Retrieve information about the current route\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#website\",\"url\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/\",\"name\":\"Pistolfly\",\"description\":\"Developer Blog\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#\\\/schema\\\/person\\\/e779e918730b507907b3a35b77a9a2ab\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#\\\/schema\\\/person\\\/e779e918730b507907b3a35b77a9a2ab\",\"name\":\"Pistolfly\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g\",\"caption\":\"Pistolfly\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g\"},\"description\":\"Software Engineer in Tokyo, Japan\",\"url\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/author\\\/pistolfly\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Retrieve information about the current route - Pistolfly","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:\/\/www.pistolfly.com\/weblog\/2007\/01\/retrieve-information-about-the.html","og_locale":"ja_JP","og_type":"article","og_title":"Retrieve information about the current route - Pistolfly","og_description":"symfony PHP5 framework Retrieve information about the current route If you need to retrieve information about &hellip; \u7d9a\u304d\u3092\u8aad\u3080 Retrieve information about the current route &rarr;","og_url":"https:\/\/www.pistolfly.com\/weblog\/2007\/01\/retrieve-information-about-the.html","og_site_name":"Pistolfly","article_published_time":"2007-01-25T09:51:20+00:00","article_modified_time":"2016-03-24T04:45:27+00:00","author":"Pistolfly","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"Pistolfly","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"1\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pistolfly.com\/weblog\/2007\/01\/retrieve-information-about-the.html#article","isPartOf":{"@id":"https:\/\/www.pistolfly.com\/weblog\/2007\/01\/retrieve-information-about-the.html"},"author":{"name":"Pistolfly","@id":"https:\/\/www.pistolfly.com\/weblog\/#\/schema\/person\/e779e918730b507907b3a35b77a9a2ab"},"headline":"Retrieve information about the current route","datePublished":"2007-01-25T09:51:20+00:00","dateModified":"2016-03-24T04:45:27+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pistolfly.com\/weblog\/2007\/01\/retrieve-information-about-the.html"},"wordCount":121,"commentCount":0,"publisher":{"@id":"https:\/\/www.pistolfly.com\/weblog\/#\/schema\/person\/e779e918730b507907b3a35b77a9a2ab"},"articleSection":["Symfony"],"inLanguage":"ja","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pistolfly.com\/weblog\/2007\/01\/retrieve-information-about-the.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pistolfly.com\/weblog\/2007\/01\/retrieve-information-about-the.html","url":"https:\/\/www.pistolfly.com\/weblog\/2007\/01\/retrieve-information-about-the.html","name":"Retrieve information about the current route - Pistolfly","isPartOf":{"@id":"https:\/\/www.pistolfly.com\/weblog\/#website"},"datePublished":"2007-01-25T09:51:20+00:00","dateModified":"2016-03-24T04:45:27+00:00","breadcrumb":{"@id":"https:\/\/www.pistolfly.com\/weblog\/2007\/01\/retrieve-information-about-the.html#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pistolfly.com\/weblog\/2007\/01\/retrieve-information-about-the.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.pistolfly.com\/weblog\/2007\/01\/retrieve-information-about-the.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u30db\u30fc\u30e0","item":"https:\/\/www.pistolfly.com\/weblog"},{"@type":"ListItem","position":2,"name":"Retrieve information about the current route"}]},{"@type":"WebSite","@id":"https:\/\/www.pistolfly.com\/weblog\/#website","url":"https:\/\/www.pistolfly.com\/weblog\/","name":"Pistolfly","description":"Developer Blog","publisher":{"@id":"https:\/\/www.pistolfly.com\/weblog\/#\/schema\/person\/e779e918730b507907b3a35b77a9a2ab"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pistolfly.com\/weblog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":["Person","Organization"],"@id":"https:\/\/www.pistolfly.com\/weblog\/#\/schema\/person\/e779e918730b507907b3a35b77a9a2ab","name":"Pistolfly","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/secure.gravatar.com\/avatar\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g","caption":"Pistolfly"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g"},"description":"Software Engineer in Tokyo, Japan","url":"https:\/\/www.pistolfly.com\/weblog\/author\/pistolfly"}]}},"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/paorzz-1N","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/posts\/111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/comments?post=111"}],"version-history":[{"count":1,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/posts\/111\/revisions"}],"predecessor-version":[{"id":3390,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/posts\/111\/revisions\/3390"}],"wp:attachment":[{"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/media?parent=111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/categories?post=111"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/tags?post=111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}