PHP code example of open20 / amos-tag

1. Go to this page and download the library: Download open20/amos-tag 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/ */

    

open20 / amos-tag example snippets


    
    'modules' => [
        'tag' => [
            'class' => 'open20\amos\tag\AmosTag',
            'modelsEnabled' => [
                /**
                 * Add here the classnames of the models for whose you want to enable tags
                 * (i.e. 'open20\amos\news\models\News')
                 */
            ]
        ],
    ],
    

    return [
        .
        .
        .
        '@vendor/open20/amos-tag/src/migrations',
        .
        .
        .
    ];
    

    echo open20\amos\tag\widgets\TagWidget::widget([
        'model' => $model,
        'attribute' => 'tagValues',
        'form' => \yii\base\Widget::$stack[0],
        'singleFixedTreeId' => $treeRoot,
        'id' => 'third-tree',
        'hideHeader' => true
    ]);

$params = \Yii::$app->request->getQueryParams();
echo \open20\amos\tag\widgets\TagWidget::widget([
    'model' => $model,
    'attribute' => 'tagValues',
    'form' => $form,
    'isSearch' => true,
    'form_values' => isset($params[$model->formName()]['tagValues']) ? $params[$model->formName()]['tagValues'] : []
]);
bash
    php yii migrate/up --migrationPath=@vendor/open20/amos-tag/src/migrations
    

 <?= \open20\amos\tag\widgets\ShowTagsWidget::widget([
    'model' => $model,
    'rootId' => $rootId
 ])