Closed MordiSacks closed 5 years ago
I've added hasTag()
to version 3.5.1, so this should work:
<select multiple>
<?php foreach ($tags as $tag): ?>
<option value="<?php echo $tag->name ?>" <?php echo $model->hasTag($tag) ? 'selected' : '' ?>>
<?php echo $tag->name ?>
</option>
<?php endforeach; ?>
</select>
This a suggestion, I would send a pull request but I'm not very familiar with unit testing my suggestion is to add this method
then if you want to check if the model has that tag just do like this
One way this could be useful