PHP code example of dnadesign / silverstripe-tagurit

1. Go to this page and download the library: Download dnadesign/silverstripe-tagurit library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dnadesign / silverstripe-tagurit example snippets

bash

    use TaxonomyTrait;

     private static $many_many = [
        'CustomTerms' => TaxonomyTerm::class
    ];
    
    public function getCMSFields()
    {
        $fields = parent::getCMSFields();

        $fields->addFieldsToTab(
            'Root.Terms',
            [
                ListboxField::create(
                    'CustomTerms',
                    'Custom Terms',
                    $this->getTermsForType('Second type')
                ),
            ]
        );

        return $fields;
    }