i have paginator that display top "n" tasks with bottuns to change or delete a task:
<?php
foreach($tasks as $task) {
?>
<li>
<div class="task-title">
<span class="task-title-sp"><?php echo $task['Task']['task']; ?></span>
<span class="badge badge-active"><?php echo $task['Task']['nicedate'] ?></span>
<div class="pull-right hidden-phone">
<button class="btn add-btn btn-xs" data-toggle="modal" data-target="#write">
<i class="fa fa-pencil"></i>
</button>
<button class="btn dismiss-btn btn-xs">
<i class="fa fa-trash-o "></i>
</button>
</div>
</div>
</li>
<?php } ?>
and on the button click it opens the modal that have text change and update bottun:
<div class="modal" id="write" tabindex="-1" role="dialog" aria-labellbyid="writeLabel">
<div class="modal-dialog" role="document">
<form id="update-form" action="/tasks/edit?id=xx" method="post">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title" aria-labellbyid="writeLabel">Unesi promjene</h4>
</div>
<div class="modal-body">
<textarea class="form-control" rows="5"></textarea>
</div>
<div class="modal-footer" id="edit-footer">
<input type="submit" class="btn see-btn" value="Ažuriraj">
</div>
</div>
</form>
</div>
</div>
so i need to get php variable $task['Task']['id']
from the paginator (inside foreach loop) and send it to modal and echo it in place of "xx" in form action.