PHP code example of open20 / amos-comments

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



'modules' => [
    'comments' => [
        'class' => 'open20\amos\comments\AmosComments',
        'modelsEnabled' => [
            /**
             * Add here the classnames of the models where you want the comments
             * (i.e. 'open20\amos\events\models\Event')
             */
        ],
        // the following are mandatory fields
        'displayNotifyCheckbox' => true, // if the notify checkbox in the accordion must be shown (if hidden, the notify checkbox is selected)
        'accordionOpenedByDefault' => false, // if the accordion must be opened by default
    ],
],


'bootstrap' => [
    'comments',
],


'components' => [
    'view' => [
        'class' => 'open20\amos\core\components\AmosView',
    ],
],


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


use open20\amos\comments\models\CommentInterface;

/**
 * Implement the CommentInterface
 */
class MyClass implements CommentInterface

/**
 * Add the 


'modules' => [
    'comments' => [
        'class' => 'open20\amos\comments\AmosComments',
        'modelsEnabled' => [
            'class_namespace\MyClass'
        ]
    ],
],


'modules' => [
    'comments' => [
        'class' => 'open20\amos\comments\AmosComments',
        'enableMailsNotification' => false,
        'modelsEnabled' => [
            'class_namespace\MyClass'
        ]
    ],
],

  'comments' => [
       'htmlMailContent' => [
            'open20\amos\news\models\News' => '@backend/mail/comment/content_news',
            'open20\amos\discussioni\models\DiscussioniTopic' => '@backend/mail/comment/content_discussioni',
            'open20\amos\documenti\models\Documenti' => '@backend/mail/comment/content_documenti'
        ],

  'comments' => [
    'htmlMailContent' => '@backend/mail/comment/content_news'
    ]

  'comments' => [
       'enableCommentOnlyWithScope' => true,
  ]
bash
php yii migrate/up --migrationPath=@vendor/open20/amos-comments/src/migrations