{"id":115,"date":"2007-02-01T16:57:50","date_gmt":"2007-02-01T07:57:50","guid":{"rendered":"https:\/\/wp-78qb7hnp.pistolfly.jp\/weblog\/2007\/02\/request-parameter.html"},"modified":"2007-02-01T16:57:50","modified_gmt":"2007-02-01T07:57:50","slug":"request-parameter","status":"publish","type":"post","link":"https:\/\/www.pistolfly.com\/weblog\/2007\/02\/request-parameter.html","title":{"rendered":"request parameter\u304b\u3089\u306e\u66f4\u65b0"},"content":{"rendered":"<p><strong>\u57fa\u672c\u30d1\u30bf\u30fc\u30f3<\/strong><\/p>\n<pre class=\"prettyprint\">if ($this->hasRequestParameter('xxx'))\n{\n  $this->model->setXxx($this->getRequestParameter('xxx'));\n}\n<\/pre>\n<p>\u307e\u305f\u306f<\/p>\n<pre class=\"prettyprint\">if ($this->getRequestParameter('xxx') !== null)\n{\n  $this->model->setXxx($this->getRequestParameter('xxx'));\n}\n<\/pre>\n<p>\u203b\u30c1\u30a7\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u306e\u5834\u5408\u306f\u3001\u30c1\u30a7\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u3092\u542b\u3080\u30d5\u30a9\u30fc\u30e0\u3092\u51e6\u7406\u3059\u308b\u30a2\u30af\u30b7\u30e7\u30f3\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30c7\u30d5\u30a9\u30eb\u30c8\u3092\u30bb\u30c3\u30c8\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n<pre class=\"prettyprint\">if (!$this->hasRequestParameter('xxx'))\n{\n  $this->getRequest()->setParameter('xxx', false);\n}\n<\/pre>\n<p>\u307e\u305f\u306f<\/p>\n<pre class=\"prettyprint\">if ($this->getRequestParameter('xxx') == null)\n{\n  $this->getRequest()->setParameter('xxx', false);\n}\n<\/pre>\n<p><strong>\u65e5\u4ed8<\/strong><br \/>\n(input_date_tag, select_day_tag+select_month_tag+select_year_tag)<\/p>\n<pre class=\"prettyprint\">if ($this->hasRequestParameter('date'))\n\/\/ \u307e\u305f\u306f if ($this->getRequestParameter('date') !== null)\n{\n  if ($this->getRequestParameter('date'))\n  {\n    try\n    {\n      $dateFormat = new sfDateFormat($this->getUser()->getCulture());\n      if (!is_array($this->getRequestParameter('date')))\n      {\n        $value = $dateFormat->format($this->getRequestParameter('date'), 'i', $dateFormat->getInputPattern('d'));\n      }\n      else\n      {\n        $value_array = $this->getRequestParameter('date');\n        if (is_numeric($value_array['year']) && is_numeric($value_array['month']) && is_numeric($value_array['day']))\n        {\n          $value = $value_array['year'].'-'.$value_array['month'].'-'.$value_array['day'].(isset($value_array['hour']) ? ' '.$value_array['hour'].':'.$value_array['minute'].(isset($value_array['second']) ? ':'.$value_array['second'] : '') : '');\n        }\n        else\n        {\n          $value = null;\n        }\n      }\n      $this->model->setDate($value);\n    }\n    catch (sfException $e)\n    {\n      \/\/ not a date\n    }\n  }\n  else\n  {\n    $this->model->setDate(null);\n  }\n}\n<\/pre>\n<p><strong>\u65e5\u4ed8\u6642\u523b<\/strong><br \/>\n\u65e5\u4ed8\u3068\u307b\u307c\u540c\u3058\u3060\u304c\u3001\u5024\u3092\u30c6\u30ad\u30b9\u30c8\u3067\u53d7\u3051\u53d6\u3063\u305f\u5834\u5408(rich=true)\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u5f15\u6570\u304c\u7570\u306a\u308b\u3002<\/p>\n<pre class=\"prettyprint\">$value = $dateFormat->format($this->getRequestParameter('date'), '<strong>i<\/strong>', $dateFormat->getInputPattern('<strong>d<\/strong>'));\n<\/pre>\n<p><strong>\u65e5\u4ed8\u6642\u523b<\/strong><\/p>\n<pre class=\"prettyprint\">$value = $dateFormat->format($this->getRequestParameter('date'), '<strong>I<\/strong>', $dateFormat->getInputPattern('<strong>g<\/strong>'));\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u57fa\u672c\u30d1\u30bf\u30fc\u30f3 if ($this->hasRequestParameter('xxx')) { $this->model->setXxx($this->getRequestParameter('xxx')); } \u307e\u305f\u306f &hellip; <a href=\"https:\/\/www.pistolfly.com\/weblog\/2007\/02\/request-parameter.html\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">request parameter\u304b\u3089\u306e\u66f4\u65b0<\/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":"","_original_post":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-115","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>request parameter\u304b\u3089\u306e\u66f4\u65b0 - 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\/02\/request-parameter.html\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"request parameter\u304b\u3089\u306e\u66f4\u65b0 - Pistolfly\" \/>\n<meta property=\"og:description\" content=\"\u57fa\u672c\u30d1\u30bf\u30fc\u30f3 if ($this-&gt;hasRequestParameter(&#039;xxx&#039;)) { $this-&gt;model-&gt;setXxx($this-&gt;getRequestParameter(&#039;xxx&#039;)); } \u307e\u305f\u306f &hellip; \u7d9a\u304d\u3092\u8aad\u3080 request parameter\u304b\u3089\u306e\u66f4\u65b0 &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pistolfly.com\/weblog\/2007\/02\/request-parameter.html\" \/>\n<meta property=\"og:site_name\" content=\"Pistolfly\" \/>\n<meta property=\"article:published_time\" content=\"2007-02-01T07:57:50+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\\\/02\\\/request-parameter.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2007\\\/02\\\/request-parameter.html\"},\"author\":{\"name\":\"Pistolfly\",\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#\\\/schema\\\/person\\\/e779e918730b507907b3a35b77a9a2ab\"},\"headline\":\"request parameter\u304b\u3089\u306e\u66f4\u65b0\",\"datePublished\":\"2007-02-01T07:57:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2007\\\/02\\\/request-parameter.html\"},\"wordCount\":16,\"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\\\/02\\\/request-parameter.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2007\\\/02\\\/request-parameter.html\",\"url\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2007\\\/02\\\/request-parameter.html\",\"name\":\"request parameter\u304b\u3089\u306e\u66f4\u65b0 - Pistolfly\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#website\"},\"datePublished\":\"2007-02-01T07:57:50+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2007\\\/02\\\/request-parameter.html#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2007\\\/02\\\/request-parameter.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2007\\\/02\\\/request-parameter.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u30db\u30fc\u30e0\",\"item\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"request parameter\u304b\u3089\u306e\u66f4\u65b0\"}]},{\"@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":"request parameter\u304b\u3089\u306e\u66f4\u65b0 - 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\/02\/request-parameter.html","og_locale":"ja_JP","og_type":"article","og_title":"request parameter\u304b\u3089\u306e\u66f4\u65b0 - Pistolfly","og_description":"\u57fa\u672c\u30d1\u30bf\u30fc\u30f3 if ($this->hasRequestParameter('xxx')) { $this->model->setXxx($this->getRequestParameter('xxx')); } \u307e\u305f\u306f &hellip; \u7d9a\u304d\u3092\u8aad\u3080 request parameter\u304b\u3089\u306e\u66f4\u65b0 &rarr;","og_url":"https:\/\/www.pistolfly.com\/weblog\/2007\/02\/request-parameter.html","og_site_name":"Pistolfly","article_published_time":"2007-02-01T07:57:50+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\/02\/request-parameter.html#article","isPartOf":{"@id":"https:\/\/www.pistolfly.com\/weblog\/2007\/02\/request-parameter.html"},"author":{"name":"Pistolfly","@id":"https:\/\/www.pistolfly.com\/weblog\/#\/schema\/person\/e779e918730b507907b3a35b77a9a2ab"},"headline":"request parameter\u304b\u3089\u306e\u66f4\u65b0","datePublished":"2007-02-01T07:57:50+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pistolfly.com\/weblog\/2007\/02\/request-parameter.html"},"wordCount":16,"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\/02\/request-parameter.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pistolfly.com\/weblog\/2007\/02\/request-parameter.html","url":"https:\/\/www.pistolfly.com\/weblog\/2007\/02\/request-parameter.html","name":"request parameter\u304b\u3089\u306e\u66f4\u65b0 - Pistolfly","isPartOf":{"@id":"https:\/\/www.pistolfly.com\/weblog\/#website"},"datePublished":"2007-02-01T07:57:50+00:00","breadcrumb":{"@id":"https:\/\/www.pistolfly.com\/weblog\/2007\/02\/request-parameter.html#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pistolfly.com\/weblog\/2007\/02\/request-parameter.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.pistolfly.com\/weblog\/2007\/02\/request-parameter.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u30db\u30fc\u30e0","item":"https:\/\/www.pistolfly.com\/weblog"},{"@type":"ListItem","position":2,"name":"request parameter\u304b\u3089\u306e\u66f4\u65b0"}]},{"@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-1R","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/posts\/115","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=115"}],"version-history":[{"count":0,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/posts\/115\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/media?parent=115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/categories?post=115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/tags?post=115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}