title: Twig: type of dynamic property
body: <p>Currently, in my index page, I show the value of object properties from dynamic object and dynamic properties.</p>
  
  <pre><code>{% for object in objects %}
      &lt;tr&gt;
          {% for property in properties %}
              &lt;td&gt;{{ attribute(object, property) }}&lt;/td&gt;
          {% endfor %}                  
      &lt;/tr&gt;
  {% endfor %}
  </code></pre>
  
  <p>Here both the objects and properties are dynamic. And I output the value of the property as <code>attribute(object, property)</code>. But there are <strong>some properties</strong> with <strong>boolean type</strong>. Currently those boolean properties gives output as <code>0</code> or <code>1</code>. I need to output <code>no</code> or <code>yes</code> instead of <code>0</code> or <code>1</code>. How can I do that?</p>
  
  <p>One option could be to find out the type of the property. But I don't know how I can get the type of the property from dynamic object and properties. </p>
  
  <p><strong>Edit:</strong> most answers are considering that all the properties are boolean type. But some of them are boolean and some of them are not boolean. </p>