Hi all!
I have a little problem, this is my code:
I'm showing all the images that are saved in a folder. I want to add a checkbox for each image so that the user can select the images he wants to download, and when he presses the button "download" only the marked images are downloaded.
My problem is that I do not know how to collect the marked images and pass them to my function that is in the controller.
Could someone help me about this in some advice or example?
Thank you in advance.
If you want to do this without Javascript:
Move your Form::open() to before <table>
Change checkbox name to img[] rather than img
Once the form is submitted you will then have an array of paths (I assume they are actually URIs) in Input::get('img')
Thank you very much for your response.
Then, do you think that my code could be like this no?:
I keep the array in variable image, and send it to the controller to do download all, right?
I don't understand what you are doing in this bit:
<?php
$images = Input::get('img');
?>
{{ Form::hidden('images', $images) }}
You should be posting the form and sending the download from there
This bit is a mistake sorry! and thank you for your response!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community