Yii-CMS is a content management system base on Yii 2.0
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
css Initial commit Feb 7, 2019
site1 Bunch of improvements related to the date field of the Post model Feb 18, 2019
uploads Initial commit Feb 7, 2019
vendor Initial commit Feb 7, 2019
README.md Update README.md Feb 14, 2019
favicon.ico Initial commit Feb 7, 2019
install.php Bunch of improvements related to the date field of the Post model Feb 18, 2019
yii Initial commit Feb 7, 2019



Yii-CMS is a content management system base on Yii 2.0.


  • Creating and managing pages, posts, multilevel menus.
  • SEO-friendly URLs.
  • Edit permission management.
  • Multi-site and multi-language support.
  • Import data from WordPress.

The system requirements

  1. PHP 5.6 or higher, SwiftMailer requires PHP 7.
  2. MySQL/MariaDB or PostgreSQL.


  1. Unpack the downloaded files to a Web-accessible folder.

    1.1. For Shared hosting environments copy all files except yii, yii.bat, README.md.

    1.2. For Self-Hosted environments copy only common, console, site1, vendor folders. Setting site1/web as the document root.

  2. Open your-site-name/install.php in your browser.

After the installation is successfully completed, you can delete install.php, console.

For Developers

Yii-CMS is a standard Yii 2.0 project. The project structure similar to the Advanced Project Template. If you are proficient in Yii 2.0, you can use Yii-CMS for your needs. If not, start here.


Configuring the RBAC permissions

The RBAC permissions are in the file common/modules/admin/rbac/Permission.php.
Add a new permission as is shown below:

const MY_PERMISSION = 'My permission description';

Get all permissions

foreach (Permission::getConstants() as $key => $value) {



The GridView widget is used to display data in a grid.


model (required)

An Active Record model.

filter (optional)

The GridView filter configuration.

'filter' => [
        'attribute' => '',//(required)
        'label' => '',//(optional)
        'operators' => [],//(optional) ['NoSet', 'Equal', 'NotEqual', 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual', 'Like']
		'value' => null,//(optional)
		'value' => null,//(optional)
		'valueHandler'  => null,//(optional)
		'readOnly' => false,//(optional)
		'visible' => true,//(optional)

showFilter (optional, default: false)

columns (optional)

The Yii 2 GridView column configuration

editAction (optional, default: "edit")

deleteAction (optional, default: "delete")

editActionsEnabled (optional, default: true)

pageSize (optional, default: 20)

defaultOrder (optional)

The default order

The example of using

$model = new User();
$model->scenario = User::SCENARIO_SEARCH;
echo GridView::widget([
    'model' => $model,
    'columns' => [
            'attribute' => 'username',
            'label' => Yii::t('app', 'Name'),
            'format' => 'text',
            'attribute' => 'email',
            'format' => 'text'
    'defaultOrder' => [
        'username' => SORT_ASC,


Yii-CMS is provided under MIT License.