【发布时间】:2020-04-30 15:03:56
【问题描述】:
嗨,我正在使用 laravel 黄昏 我有这样的数组输入..
<input type='text' name='debits[]' />
<input type='text' name='debits[]' />
如何使用数组的键为第一个或第二个或特定输入添加值,如
public function create(Browser $browser)
{
$browser
->select('journal_id',1)
->pause(100)
->click('.add-line')
->click('.add-line')
// code here to add 10 to first debits
// code here to add 15 to second debits
;
}
可以吗,非常感谢..
【问题讨论】:
-
stackoverflow.com/questions/44283669/… 建议使用例如
array_name[]:nth-child(1) -
你能把你的代码推送到 GitHub 上吗?我的意思是测试部分。