简体   繁体   English

如何在select symfony2中获取option的值

[英]How to get the value of option in select symfony2

I entred a select section in my view with two options. 我在视图中使用两个选项进入了选择部分。 I want to get the value selected and then depending on the entred value, I'll get a specific action. 我想获取选定的值,然后根据输入的值执行特定的操作。 How to do that? 怎么做?

对于包含输入变量'foo'的POSTed表单,

$foo = $request->request->get('foo');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM