I entered project_toolbox into my plugin's database table and created checkbox list named project_toolbox with 10 values. How can I retrieve those value if checked from the backend.
Here is what I was unable to get the value of the checkbox value
<div >
{% for toolbox in project.project_toolbox %}
<div ><span>{{ toolbox.name }} Hello</span></div>
{% endfor %}
</div>
CodePudding user response:
You can simply iterate through array
<div >
{% for toolbox_item in project.project_toolbox %}
<div ><span>{{ toolbox_item }} Hello</span></div>
{% endfor %}
</div>
You can directly use string value
{{ toolbox_item }}
asproject_toolbox
is the array of strings.
if any doubt please comment.