Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

NumberRangeFilterType can not set attribute " type:'number' '' , and 'label' is not work as well #323

Open
CuteDeng opened this issue Nov 27, 2019 · 3 comments

Comments

@CuteDeng
Copy link

CuteDeng commented Nov 27, 2019

In my project , I'm trying to use NumberRangeFilterType, but I found that a string value still can input to this form, and when I submit the form, the program throw an error => "No value found for key "left_number" in form data." So I try to set the following attribute, not work, can anyone tell me, what's the problem is ? thank you.

 ->add('age', NumberRangeFilterType::class, [
                'left_number_options'=>[
                    'label' => 'LABEL_FROM',
                    'attr' => [
                        'type' => 'number'
                    ]
                ],
                'right_number_options'=>[
                    'label'=>'LABEL_TO',
                    'attr' => [
                        'type' => 'number'
                    ]
                ],
               
            ])
@CuteDeng CuteDeng changed the title NumberRangeFilterType can not set attr " type:'number' '' NumberRangeFilterType can not set attribute " type:'number' '' , and 'label' is not work as well Nov 27, 2019
@gilles-g
Copy link
Member

Hi,

Did you check the profiler to see the request parameters?

I'm not sure to understand the problem...are the values submited?

Could you show the request?

@CuteDeng
Copy link
Author

CuteDeng commented Nov 28, 2019

Hi,
@Spike31 Hi~, My question is not clear yesterday,Today I redescribe it, the kernel question is when I input a string throw "No value found for key "right_number" in form data." ,when I input a number no error, for example : when I input "60xxx" throw error, "60" is ok
Did you check the profiler to see the request parameters?
yes, here is the parameters

["parameters":protected]=>
    array(2) {
      ["_search"]=>
      string(1) "1"
      ["age"]=>
      array(2) {
        ["left_number"]=>
        string(1) "10"
        ["right_number"]=>
        string(5) "60xxx"
      }
    }

I'm not sure to understand the problem...are the values submited?
yes
Could you show the request?

object(Symfony\Component\HttpFoundation\Request)#9 (23) {
  ["attributes"]=>
  object(Symfony\Component\HttpFoundation\ParameterBag)#12 (1) {
    ["parameters":protected]=>
    array(4) {
      ["_controller"]=>
      string(52) "AdminBundle\Controller\MemberController::indexAction"
      ["_route"]=>
      string(12) "admin.member"
      ["_route_params"]=>
      array(0) {
      }
      ["_firewall_context"]=>
      string(40) "security.firewall.map.context.admintools"
    }
  }
  ["request"]=>
  object(Symfony\Component\HttpFoundation\ParameterBag)#10 (1) {
    ["parameters":protected]=>
    array(0) {
    }
  }
  ["query"]=>
  object(Symfony\Component\HttpFoundation\ParameterBag)#11 (1) {
    ["parameters":protected]=>
    array(2) {
      ["_search"]=>
      string(1) "1"
      ["age"]=>
      array(2) {
        ["left_number"]=>
        string(2) "10"
        ["right_number"]=>
        string(5) "60xxx"
      }
    }
  }
  ["server"]=>
  object(Symfony\Component\HttpFoundation\ServerBag)#15 (1) {
    ["parameters":protected]=>
    array(37) {
      ["USER"]=>
      string(3) "dxw"
      ["HOME"]=>
      string(10) "/Users/dxw"
      ["HTTP_COOKIE"]=>
      string(230) "_ga=GA1.2.1312971010.1535006316; __utmz=256767373.1558951676.3.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=256767373.1312971010.1535006316.1558951676.1571913177.4; device_view=full; PHPSESSID=4irs6gepiqat2fd0ek77buh4rl"
      ["HTTP_ACCEPT_LANGUAGE"]=>
      string(14) "zh-CN,zh;q=0.9"
      ["HTTP_ACCEPT_ENCODING"]=>
      string(13) "gzip, deflate"
      ["HTTP_REFERER"]=>
      string(56) "http://buybuy-cms.l.wizmacau.com/admintools/info/member/"
      ["HTTP_ACCEPT"]=>
      string(118) "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3"
      ["HTTP_USER_AGENT"]=>
      string(120) "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36"
      ["HTTP_UPGRADE_INSECURE_REQUESTS"]=>
      string(1) "1"
      ["HTTP_CACHE_CONTROL"]=>
      string(8) "no-cache"
      ["HTTP_PRAGMA"]=>
      string(8) "no-cache"
      ["HTTP_CONNECTION"]=>
      string(10) "keep-alive"
      ["HTTP_HOST"]=>
      string(25) "buybuy-cms.l.wizmacau.com"
      ["HTTPS"]=>
      string(3) "off"
      ["SCRIPT_FILENAME"]=>
      string(45) "/Users/dxw/Web/www/buybuy-cms/web/app_dev.php"
      ["REDIRECT_STATUS"]=>
      string(3) "200"
      ["SERVER_NAME"]=>
      string(25) "buybuy-cms.l.wizmacau.com"
      ["SERVER_PORT"]=>
      string(2) "80"
      ["SERVER_ADDR"]=>
      string(9) "127.0.0.1"
      ["REMOTE_PORT"]=>
      string(5) "52070"
      ["REMOTE_ADDR"]=>
      string(9) "127.0.0.1"
      ["SERVER_SOFTWARE"]=>
      string(12) "nginx/1.15.2"
      ["GATEWAY_INTERFACE"]=>
      string(7) "CGI/1.1"
      ["REQUEST_SCHEME"]=>
      string(4) "http"
      ["SERVER_PROTOCOL"]=>
      string(8) "HTTP/1.1"
      ["DOCUMENT_ROOT"]=>
      string(33) "/Users/dxw/Web/www/buybuy-cms/web"
      ["DOCUMENT_URI"]=>
      string(12) "/app_dev.php"
      ["REQUEST_URI"]=>
      string(86) "/admintools/info/member/?_search=1&age%5Bleft_number%5D=10&age%5Bright_number%5D=60xxx"
      ["SCRIPT_NAME"]=>
      string(12) "/app_dev.php"
      ["CONTENT_LENGTH"]=>
      string(0) ""
      ["CONTENT_TYPE"]=>
      string(0) ""
      ["REQUEST_METHOD"]=>
      string(3) "GET"
      ["QUERY_STRING"]=>
      string(61) "_search=1&age%5Bleft_number%5D=10&age%5Bright_number%5D=60xxx"
      ["FCGI_ROLE"]=>
      string(9) "RESPONDER"
      ["PHP_SELF"]=>
      string(12) "/app_dev.php"
      ["REQUEST_TIME_FLOAT"]=>
      float(1574911290.068)
      ["REQUEST_TIME"]=>
      int(1574911290)
    }
  }
  ["files"]=>
  object(Symfony\Component\HttpFoundation\FileBag)#14 (1) {
    ["parameters":protected]=>
    array(0) {
    }
  }
  ["cookies"]=>
  object(Symfony\Component\HttpFoundation\ParameterBag)#13 (1) {
    ["parameters":protected]=>
    array(5) {
      ["_ga"]=>
      string(27) "GA1.2.1312971010.1535006316"
      ["__utmz"]=>
      string(70) "256767373.1558951676.3.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)"
      ["__utma"]=>
      string(55) "256767373.1312971010.1535006316.1558951676.1571913177.4"
      ["device_view"]=>
      string(4) "full"
      ["PHPSESSID"]=>
      string(26) "4irs6gepiqat2fd0ek77buh4rl"
    }
  }
  ["headers"]=>
  object(Symfony\Component\HttpFoundation\HeaderBag)#16 (2) {
    ["headers":protected]=>
    array(14) {
      ["cookie"]=>
      array(1) {
        [0]=>
        string(230) "_ga=GA1.2.1312971010.1535006316; __utmz=256767373.1558951676.3.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=256767373.1312971010.1535006316.1558951676.1571913177.4; device_view=full; PHPSESSID=4irs6gepiqat2fd0ek77buh4rl"
      }
      ["accept-language"]=>
      array(1) {
        [0]=>
        string(14) "zh-CN,zh;q=0.9"
      }
      ["accept-encoding"]=>
      array(1) {
        [0]=>
        string(13) "gzip, deflate"
      }
      ["referer"]=>
      array(1) {
        [0]=>
        string(56) "http://buybuy-cms.l.wizmacau.com/admintools/info/member/"
      }
      ["accept"]=>
      array(1) {
        [0]=>
        string(118) "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3"
      }
      ["user-agent"]=>
      array(1) {
        [0]=>
        string(120) "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36"
      }
      ["upgrade-insecure-requests"]=>
      array(1) {
        [0]=>
        string(1) "1"
      }
      ["cache-control"]=>
      array(1) {
        [0]=>
        string(8) "no-cache"
      }
      ["pragma"]=>
      array(1) {
        [0]=>
        string(8) "no-cache"
      }
      ["connection"]=>
      array(1) {
        [0]=>
        string(10) "keep-alive"
      }
      ["host"]=>
      array(1) {
        [0]=>
        string(25) "buybuy-cms.l.wizmacau.com"
      }
      ["content-length"]=>
      array(1) {
        [0]=>
        string(0) ""
      }
      ["content-type"]=>
      array(1) {
        [0]=>
        string(0) ""
      }
      ["x-php-ob-level"]=>
      array(1) {
        [0]=>
        int(1)
      }
    }
    ["cacheControl":protected]=>
    array(1) {
      ["no-cache"]=>
      bool(true)
    }
  }
  ["content":protected]=>
  NULL
  ["languages":protected]=>
  NULL
  ["charsets":protected]=>
  NULL
  ["encodings":protected]=>
  NULL
  ["acceptableContentTypes":protected]=>
  NULL
  ["pathInfo":protected]=>
  string(24) "/admintools/info/member/"
  ["requestUri":protected]=>
  string(86) "/admintools/info/member/?_search=1&age%5Bleft_number%5D=10&age%5Bright_number%5D=60xxx"
  ["baseUrl":protected]=>
  string(0) ""
  ["basePath":protected]=>
  NULL
  ["method":protected]=>
  string(3) "GET"
  ["format":protected]=>
  NULL
  ["session":protected]=>
  object(Symfony\Component\HttpFoundation\Session\Session)#327 (5) {
    ["storage":protected]=>
    object(Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage)#326 (5) {
      ["bags":protected]=>
      array(2) {
        ["attributes"]=>
        object(Symfony\Component\HttpFoundation\Session\SessionBagProxy)#320 (3) {
          ["bag":"Symfony\Component\HttpFoundation\Session\SessionBagProxy":private]=>
          object(Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag)#318 (3) {
            ["name":"Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag":private]=>
            string(10) "attributes"
            ["storageKey":"Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag":private]=>
            string(15) "_sf2_attributes"
            ["attributes":protected]=>
            &array(15) {
              ["_csrf/form"]=>
              string(43) "tXcF1s4EIPh2NLMo11BZJVZHjPv2A8qddzyf_GGOBRI"
              ["_csrf/Wiz\AdminTools\Component\Framework\Form\Setting\SystemSettingType"]=>
              string(43) "dfDDZ5xZsT2W8ctRSWUulrZzwdwB_x7yYcrDKS4eS5U"
              ["_csrf/setting"]=>
              string(43) "vlMiIK0rZFFMaJGIjmaANH3lofhZs4yOF4006UwBbOE"
              ["_security_admintools"]=>
              string(758) "C:74:"Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken":670:{a:3:{i:0;N;i:1;s:10:"admintools";i:2;a:4:{i:0;C:47:"Wiz\AdminTools\Bundle\UserBundle\Entity\FosUser":269:{a:8:{i:0;s:88:"tKuIfLFJ8P09C5ajAi+rH7fGVPSZpL87ufCutn+LrMkCxBK4yVFzVMWbCkCAmWxE3F4s0NLtFG+cwzMiZuXoLg==";i:1;s:43:"L4ry2zcN1m4j843umoyMSsreqc.rO0kiyBOhK6XOZL4";i:2;s:5:"admin";i:3;s:5:"admin";i:4;b:1;i:5;i:1;i:6;s:18:"admin@wizmacau.com";i:7;s:18:"admin@wizmacau.com";}}i:1;b:1;i:2;a:2:{i:0;O:41:"Symfony\Component\Security\Core\Role\Role":1:{s:47:"Symfony\Component\Security\Core\Role\Rolerole";s:16:"ROLE_SUPER_ADMIN";}i:1;O:41:"Symfony\Component\Security\Core\Role\Role":1:{s:47:"Symfony\Component\Security\Core\Role\Rolerole";s:9:"ROLE_USER";}}i:3;a:0:{}}}}"
              ["_csrf/member"]=>
              string(43) "xtCwg8OOJCnXbYQuR0m1shX1PfAhW6x2euxK7MmFlx8"
              ["page:admin.lottery_draw_log"]=>
              string(1) "1"
              ["_csrf/take_prize"]=>
              string(43) "GgwzAVDPt4DkwTgGU-4SdY6ulMERcKaI3fkWKZX7QII"
              ["_csrf/lottery_prize"]=>
              string(43) "zhx4zth_nweeWReumHSgPTNfpfc7Cl27pWBbNTwrgFI"
              ["_csrf/lottery_win_rule"]=>
              string(43) "RKenUub-5KVI8cRSUyRj8qbJ-ifRauFw7CA7ixGlVo4"
              ["_csrf/activity"]=>
              string(43) "J6s4PWTroeg1j0XH5znvYhZgvC6GfAjuvC0sUPPznfc"
              ["filter:admin.redeem_coupon"]=>
              array(1) {
                ["status"]=>
                string(2) "-1"
              }
              ["_csrf/redeem_coupon"]=>
              string(43) "EXHtopyKE0db8rCUgCCraj8nfya0boBArT_hlU4RT0M"
              ["_csrf/machine"]=>
              string(43) "TEvlO5_18YyC_YIjTQw-jPuWB8Hot_3qgjeZhvVUsQs"
              ["filter:admin.machine"]=>
              array(1) {
                ["assetNo"]=>
                string(7) "SVB-090"
              }
              ["filter:admin.member"]=>
              array(1) {
                ["age"]=>
                array(2) {
                  ["left_number"]=>
                  string(2) "10"
                  ["right_number"]=>
                  string(5) "60xxx"
                }
              }
            }
          }
          ["data":"Symfony\Component\HttpFoundation\Session\SessionBagProxy":private]=>
          &array(2) {
            ["_sf2_attributes"]=>
            &array(15) {
              ["_csrf/form"]=>
              string(43) "tXcF1s4EIPh2NLMo11BZJVZHjPv2A8qddzyf_GGOBRI"
              ["_csrf/Wiz\AdminTools\Component\Framework\Form\Setting\SystemSettingType"]=>
              string(43) "dfDDZ5xZsT2W8ctRSWUulrZzwdwB_x7yYcrDKS4eS5U"
              ["_csrf/setting"]=>
              string(43) "vlMiIK0rZFFMaJGIjmaANH3lofhZs4yOF4006UwBbOE"
              ["_security_admintools"]=>
              string(758) "C:74:"Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken":670:{a:3:{i:0;N;i:1;s:10:"admintools";i:2;a:4:{i:0;C:47:"Wiz\AdminTools\Bundle\UserBundle\Entity\FosUser":269:{a:8:{i:0;s:88:"tKuIfLFJ8P09C5ajAi+rH7fGVPSZpL87ufCutn+LrMkCxBK4yVFzVMWbCkCAmWxE3F4s0NLtFG+cwzMiZuXoLg==";i:1;s:43:"L4ry2zcN1m4j843umoyMSsreqc.rO0kiyBOhK6XOZL4";i:2;s:5:"admin";i:3;s:5:"admin";i:4;b:1;i:5;i:1;i:6;s:18:"admin@wizmacau.com";i:7;s:18:"admin@wizmacau.com";}}i:1;b:1;i:2;a:2:{i:0;O:41:"Symfony\Component\Security\Core\Role\Role":1:{s:47:"Symfony\Component\Security\Core\Role\Rolerole";s:16:"ROLE_SUPER_ADMIN";}i:1;O:41:"Symfony\Component\Security\Core\Role\Role":1:{s:47:"Symfony\Component\Security\Core\Role\Rolerole";s:9:"ROLE_USER";}}i:3;a:0:{}}}}"
              ["_csrf/member"]=>
              string(43) "xtCwg8OOJCnXbYQuR0m1shX1PfAhW6x2euxK7MmFlx8"
              ["page:admin.lottery_draw_log"]=>
              string(1) "1"
              ["_csrf/take_prize"]=>
              string(43) "GgwzAVDPt4DkwTgGU-4SdY6ulMERcKaI3fkWKZX7QII"
              ["_csrf/lottery_prize"]=>
              string(43) "zhx4zth_nweeWReumHSgPTNfpfc7Cl27pWBbNTwrgFI"
              ["_csrf/lottery_win_rule"]=>
              string(43) "RKenUub-5KVI8cRSUyRj8qbJ-ifRauFw7CA7ixGlVo4"
              ["_csrf/activity"]=>
              string(43) "J6s4PWTroeg1j0XH5znvYhZgvC6GfAjuvC0sUPPznfc"
              ["filter:admin.redeem_coupon"]=>
              array(1) {
                ["status"]=>
                string(2) "-1"
              }
              ["_csrf/redeem_coupon"]=>
              string(43) "EXHtopyKE0db8rCUgCCraj8nfya0boBArT_hlU4RT0M"
              ["_csrf/machine"]=>
              string(43) "TEvlO5_18YyC_YIjTQw-jPuWB8Hot_3qgjeZhvVUsQs"
              ["filter:admin.machine"]=>
              array(1) {
                ["assetNo"]=>
                string(7) "SVB-090"
              }
              ["filter:admin.member"]=>
              array(1) {
                ["age"]=>
                array(2) {
                  ["left_number"]=>
                  string(2) "10"
                  ["right_number"]=>
                  string(5) "60xxx"
                }
              }
            }
            ["_symfony_flashes"]=>
            &array(0) {
            }
          }
          ["usageIndex":"Symfony\Component\HttpFoundation\Session\SessionBagProxy":private]=>
          &int(4)
        }
        ["flashes"]=>
        object(Symfony\Component\HttpFoundation\Session\SessionBagProxy)#321 (3) {
          ["bag":"Symfony\Component\HttpFoundation\Session\SessionBagProxy":private]=>
          object(Symfony\Component\HttpFoundation\Session\Flash\FlashBag)#319 (3) {
            ["name":"Symfony\Component\HttpFoundation\Session\Flash\FlashBag":private]=>
            string(7) "flashes"
            ["flashes":"Symfony\Component\HttpFoundation\Session\Flash\FlashBag":private]=>
            &array(0) {
            }
            ["storageKey":"Symfony\Component\HttpFoundation\Session\Flash\FlashBag":private]=>
            string(16) "_symfony_flashes"
          }
          ["data":"Symfony\Component\HttpFoundation\Session\SessionBagProxy":private]=>
          &array(2) {
            ["_sf2_attributes"]=>
            &array(15) {
              ["_csrf/form"]=>
              string(43) "tXcF1s4EIPh2NLMo11BZJVZHjPv2A8qddzyf_GGOBRI"
              ["_csrf/Wiz\AdminTools\Component\Framework\Form\Setting\SystemSettingType"]=>
              string(43) "dfDDZ5xZsT2W8ctRSWUulrZzwdwB_x7yYcrDKS4eS5U"
              ["_csrf/setting"]=>
              string(43) "vlMiIK0rZFFMaJGIjmaANH3lofhZs4yOF4006UwBbOE"
              ["_security_admintools"]=>
              string(758) "C:74:"Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken":670:{a:3:{i:0;N;i:1;s:10:"admintools";i:2;a:4:{i:0;C:47:"Wiz\AdminTools\Bundle\UserBundle\Entity\FosUser":269:{a:8:{i:0;s:88:"tKuIfLFJ8P09C5ajAi+rH7fGVPSZpL87ufCutn+LrMkCxBK4yVFzVMWbCkCAmWxE3F4s0NLtFG+cwzMiZuXoLg==";i:1;s:43:"L4ry2zcN1m4j843umoyMSsreqc.rO0kiyBOhK6XOZL4";i:2;s:5:"admin";i:3;s:5:"admin";i:4;b:1;i:5;i:1;i:6;s:18:"admin@wizmacau.com";i:7;s:18:"admin@wizmacau.com";}}i:1;b:1;i:2;a:2:{i:0;O:41:"Symfony\Component\Security\Core\Role\Role":1:{s:47:"Symfony\Component\Security\Core\Role\Rolerole";s:16:"ROLE_SUPER_ADMIN";}i:1;O:41:"Symfony\Component\Security\Core\Role\Role":1:{s:47:"Symfony\Component\Security\Core\Role\Rolerole";s:9:"ROLE_USER";}}i:3;a:0:{}}}}"
              ["_csrf/member"]=>
              string(43) "xtCwg8OOJCnXbYQuR0m1shX1PfAhW6x2euxK7MmFlx8"
              ["page:admin.lottery_draw_log"]=>
              string(1) "1"
              ["_csrf/take_prize"]=>
              string(43) "GgwzAVDPt4DkwTgGU-4SdY6ulMERcKaI3fkWKZX7QII"
              ["_csrf/lottery_prize"]=>
              string(43) "zhx4zth_nweeWReumHSgPTNfpfc7Cl27pWBbNTwrgFI"
              ["_csrf/lottery_win_rule"]=>
              string(43) "RKenUub-5KVI8cRSUyRj8qbJ-ifRauFw7CA7ixGlVo4"
              ["_csrf/activity"]=>
              string(43) "J6s4PWTroeg1j0XH5znvYhZgvC6GfAjuvC0sUPPznfc"
              ["filter:admin.redeem_coupon"]=>
              array(1) {
                ["status"]=>
                string(2) "-1"
              }
              ["_csrf/redeem_coupon"]=>
              string(43) "EXHtopyKE0db8rCUgCCraj8nfya0boBArT_hlU4RT0M"
              ["_csrf/machine"]=>
              string(43) "TEvlO5_18YyC_YIjTQw-jPuWB8Hot_3qgjeZhvVUsQs"
              ["filter:admin.machine"]=>
              array(1) {
                ["assetNo"]=>
                string(7) "SVB-090"
              }
              ["filter:admin.member"]=>
              array(1) {
                ["age"]=>
                array(2) {
                  ["left_number"]=>
                  string(2) "10"
                  ["right_number"]=>
                  string(5) "60xxx"
                }
              }
            }
            ["_symfony_flashes"]=>
            &array(0) {
            }
          }
          ["usageIndex":"Symfony\Component\HttpFoundation\Session\SessionBagProxy":private]=>
          &int(4)
        }
      }
      ["started":protected]=>
      bool(true)
      ["closed":protected]=>
      bool(false)
      ["saveHandler":protected]=>
      object(Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy)#317 (3) {
        ["handler":protected]=>
        object(Symfony\Component\HttpFoundation\Session\Storage\Handler\StrictSessionHandler)#325 (7) {
          ["handler":"Symfony\Component\HttpFoundation\Session\Storage\Handler\StrictSessionHandler":private]=>
          object(Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler)#291 (0) {
          }
          ["doDestroy":"Symfony\Component\HttpFoundation\Session\Storage\Handler\StrictSessionHandler":private]=>
          NULL
          ["sessionName":"Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler":private]=>
          string(9) "PHPSESSID"
          ["prefetchId":"Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler":private]=>
          NULL
          ["prefetchData":"Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler":private]=>
          NULL
          ["newSessionId":"Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler":private]=>
          NULL
          ["igbinaryEmptyData":"Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler":private]=>
          NULL
        }
        ["wrapper":protected]=>
        bool(false)
        ["saveHandlerName":protected]=>
        string(4) "user"
      }
      ["metadataBag":protected]=>
      object(Symfony\Component\HttpFoundation\Session\Storage\MetadataBag)#308 (5) {
        ["name":"Symfony\Component\HttpFoundation\Session\Storage\MetadataBag":private]=>
        string(10) "__metadata"
        ["storageKey":"Symfony\Component\HttpFoundation\Session\Storage\MetadataBag":private]=>
        string(9) "_sf2_meta"
        ["meta":protected]=>
        &array(3) {
          ["u"]=>
          int(1574911290)
          ["c"]=>
          int(1573799837)
          ["l"]=>
          string(1) "0"
        }
        ["lastUsed":"Symfony\Component\HttpFoundation\Session\Storage\MetadataBag":private]=>
        int(1574911263)
        ["updateThreshold":"Symfony\Component\HttpFoundation\Session\Storage\MetadataBag":private]=>
        string(1) "0"
      }
    }
    ["flashName":"Symfony\Component\HttpFoundation\Session\Session":private]=>
    string(7) "flashes"
    ["attributeName":"Symfony\Component\HttpFoundation\Session\Session":private]=>
    string(10) "attributes"
    ["data":"Symfony\Component\HttpFoundation\Session\Session":private]=>
    &array(2) {
      ["_sf2_attributes"]=>
      &array(15) {
        ["_csrf/form"]=>
        string(43) "tXcF1s4EIPh2NLMo11BZJVZHjPv2A8qddzyf_GGOBRI"
        ["_csrf/Wiz\AdminTools\Component\Framework\Form\Setting\SystemSettingType"]=>
        string(43) "dfDDZ5xZsT2W8ctRSWUulrZzwdwB_x7yYcrDKS4eS5U"
        ["_csrf/setting"]=>
        string(43) "vlMiIK0rZFFMaJGIjmaANH3lofhZs4yOF4006UwBbOE"
        ["_security_admintools"]=>
        string(758) "C:74:"Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken":670:{a:3:{i:0;N;i:1;s:10:"admintools";i:2;a:4:{i:0;C:47:"Wiz\AdminTools\Bundle\UserBundle\Entity\FosUser":269:{a:8:{i:0;s:88:"tKuIfLFJ8P09C5ajAi+rH7fGVPSZpL87ufCutn+LrMkCxBK4yVFzVMWbCkCAmWxE3F4s0NLtFG+cwzMiZuXoLg==";i:1;s:43:"L4ry2zcN1m4j843umoyMSsreqc.rO0kiyBOhK6XOZL4";i:2;s:5:"admin";i:3;s:5:"admin";i:4;b:1;i:5;i:1;i:6;s:18:"admin@wizmacau.com";i:7;s:18:"admin@wizmacau.com";}}i:1;b:1;i:2;a:2:{i:0;O:41:"Symfony\Component\Security\Core\Role\Role":1:{s:47:"Symfony\Component\Security\Core\Role\Rolerole";s:16:"ROLE_SUPER_ADMIN";}i:1;O:41:"Symfony\Component\Security\Core\Role\Role":1:{s:47:"Symfony\Component\Security\Core\Role\Rolerole";s:9:"ROLE_USER";}}i:3;a:0:{}}}}"
        ["_csrf/member"]=>
        string(43) "xtCwg8OOJCnXbYQuR0m1shX1PfAhW6x2euxK7MmFlx8"
        ["page:admin.lottery_draw_log"]=>
        string(1) "1"
        ["_csrf/take_prize"]=>
        string(43) "GgwzAVDPt4DkwTgGU-4SdY6ulMERcKaI3fkWKZX7QII"
        ["_csrf/lottery_prize"]=>
        string(43) "zhx4zth_nweeWReumHSgPTNfpfc7Cl27pWBbNTwrgFI"
        ["_csrf/lottery_win_rule"]=>
        string(43) "RKenUub-5KVI8cRSUyRj8qbJ-ifRauFw7CA7ixGlVo4"
        ["_csrf/activity"]=>
        string(43) "J6s4PWTroeg1j0XH5znvYhZgvC6GfAjuvC0sUPPznfc"
        ["filter:admin.redeem_coupon"]=>
        array(1) {
          ["status"]=>
          string(2) "-1"
        }
        ["_csrf/redeem_coupon"]=>
        string(43) "EXHtopyKE0db8rCUgCCraj8nfya0boBArT_hlU4RT0M"
        ["_csrf/machine"]=>
        string(43) "TEvlO5_18YyC_YIjTQw-jPuWB8Hot_3qgjeZhvVUsQs"
        ["filter:admin.machine"]=>
        array(1) {
          ["assetNo"]=>
          string(7) "SVB-090"
        }
        ["filter:admin.member"]=>
        array(1) {
          ["age"]=>
          array(2) {
            ["left_number"]=>
            string(2) "10"
            ["right_number"]=>
            string(5) "60xxx"
          }
        }
      }
      ["_symfony_flashes"]=>
      &array(0) {
      }
    }
    ["usageIndex":"Symfony\Component\HttpFoundation\Session\Session":private]=>
    &int(4)
  }
  ["locale":protected]=>
  NULL
  ["defaultLocale":protected]=>
  string(5) "zh_TW"
  ["isHostValid":"Symfony\Component\HttpFoundation\Request":private]=>
  bool(true)
  ["isForwardedValid":"Symfony\Component\HttpFoundation\Request":private]=>
  bool(true)
}

@sokoloowski
Copy link

@CuteDeng try this:

// ...
->add('age', Filters\NumberRangeFilterType::class, [
    'left_number_options' => [
        'label' => 'LABEL_FROM',
        'html5' => true
    ],
    'right_number_options' => [
        'label' => 'LABEL_TO',
        'html5' => true
    ]
])
// ...

Source: NumberType field (Symfony Docs)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants