Skip to content

Installation

Requirements

Before installing Akismet for Yii, you need to make sure you have PHP and Composer, the PHP package manager, up and running.

You can verify if you're already good to go with the following commands:

php --version
# PHP 7.4.7 (cli) (built: Jun  9 2020 13:34:30) ( NTS Visual C++ 2017 x64 )

composer --version
# Composer version 1.10.7 2020-06-03 10:03:56

Info

If you plan to play with the package sources, you will also need the latest versions of PowerShell and Material for MkDocs.

Installing with Composer package manager

1. Install it

From a command prompt, run:

composer require cedx/yii2-akismet

2. Import it

Now in your PHP code, you can use:

<?php
use yii\akismet\{
    Author,
    Blog,
    CheckResult,
    Client,
    ClientException,
    Comment,
    CommentType
};