public function tagsChooser(EntityInterface $entity, $attachment)
    {
        if (!TableRegistry::exists($entity->source())) {
            throw new Cake\Network\Exception\MissingTableException('Could not find Table ' . $entity->source());
        }
        $Table = TableRegistry::get($entity->source());

        return $this->Form->select('tags', $Table->getAttachmentsTags(), [
            'type' => 'select',
            'class' => 'tag-chooser',
            'style' => 'display: block; width: 100%',
            'label' => false,
            'multiple' => true,
            'value' => $attachment->tags
        ]);
    }
public function tagsChooser(EntityInterface $entity, $attachment)
    {
        if (!TableRegistry::exists($entity->source())) {
            throw new Cake\Network\Exception\MissingTableException('Could not find Table ' . $entity->source());
        }
        $Table = TableRegistry::get($entity->source());

        return $this->Form->select('tags', $Table->getAttachmentsTags(), [
            'type' => 'select',
            'class' => 'tag-chooser',
            'style' => 'display: block; width: 100%',
            'label' => false,
            'multiple' => true,
            'value' => $attachment->tags
        ]);
    }
public function tagsChooser ( EntityInterface $ entity , $ attachment ) { if ( ! TableRegistry :: exists ( $ entity -> source ( ) ) ) { throw new Cake \ Network \ Exception \ MissingTableException ( 'Could not find Table ' . $ entity -> source ( ) ) ; } $ Table = TableRegistry :: get ( $ entity -> source ( ) ) ; return $ this -> Form -> select ( 'tags' , $ Table -> getAttachmentsTags ( ) , [ 'type' => 'select' , 'class' => 'tag-chooser' , 'style' => 'display: block; width: 100%' , 'label' => false , 'multiple' => true , 'value' => $ attachment -> tags ] ) ; }
Render a multi select with all available tags of entity and the tags of attachment preselected

@param  EntityInterface                    $entity     the entity to get all allowed tags from
@param  Attachment\Model\Entity\Attachment $attachment the attachment entity to add the tag to
@return string
Render a multi select with all available tags of entity and the tags of attachment preselected