Home > Net >  How to get value from checkbox list in October CMS custom plugin
How to get value from checkbox list in October CMS custom plugin

Time:05-10

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>

enter image description here

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 }} as project_toolbox is the array of strings.

if any doubt please comment.

  • Related