获取选择框值Laravel

时间:2017-10-24 11:16:06

标签: php laravel-5 eloquent

我使用laravel 5.4。

tcpdump -i v100 -nnvXSs 0 -w /tmp/tr.pcap  
tcpdump -nnvXSs 0 -A -r /tmp/tr.pcap "src host ${client_ip}"
Result should contain  ${client_ip}

我将数据记录到数据库中。但我无法获得选择框标签的值。我在Controller中使用以下代码,因此我得到了文本。

   <select name="type" id="type">
     <option value="0">title1</option>
     <option value="1" selected>title2</option>
     <option value="2">title3</option>
    </select>

结果:“title2”

我在研究中没有找到任何结果。请帮帮我。有推荐吗?

2 个答案:

答案 0 :(得分:1)

$request->get('type')更改为$request->input('type')

答案 1 :(得分:0)

最简单的方法是@IBOutlet weak var messageView: UIView! @IBOutlet weak var messageViewHeightConstraint: NSLayoutConstraint! @IBOutlet weak var messageTextView: UITextView! @IBOutlet weak var messageTextViewHeightConstraint: NSLayoutConstraint! extension MessageLogVC : UITextViewDelegate { func textViewDidChange(_ textView: UITextView) { let width = messageView.frame.width - attachImageView.frame.width - sendImageView.frame.width let size = CGSize(width: width, height: 100) let estimateSize = textView.sizeThatFits(size) if messageViewHeightConstraint.constant < estimateSize.height { messageViewHeightConstraint.constant = estimateSize.height messageTextViewHeightConstraint.constant = estimateSize.height } if messageViewHeightConstraint.constant > estimateSize.height { messageViewHeightConstraint.constant = 50 messageTextViewHeightConstraint.constant = 50 } } } 来获取控制器中select选项的值;)