php - Laravel form action parameter -
i'm trying call controller method form object, increment given item.
the problem when adding parameter, form action add question mark, instead of slash.
<form method="post" action="http://localhost/admin/pages?1">
how define parameter?
{!! form::open([ 'action'=>['admin\\pagescontroller@increment', $item->id], 'style' => 'display:inline' ]) !!} {!! form::submit('move up', ['class' => 'btn btn-danger btn-xs']) !!} {!! form::close() !!}
in code sample, sending item id http parameter. can access item id in controller giving name parameter follows.
{!! form::open([ 'action'=>['admin\\pagescontroller@increment','itemid='.$item->id], 'style' => 'display:inline' ]) !!}
then access item id in controller by
input:get('itemid')
Comments
Post a Comment