Search by

klsoft / yii3-cms

klsoft-web

A content management system based on the Yii3 framework that uses the Doctrine ORM. It can be customised using the Composer package manager.

Package info

github.com/klsoft-web/yii3-cms

Type:project

pkg:composer/klsoft/yii3-cms

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-12-03 12:44 UTC

This package is auto-updated.

Last update: 2026-12-03 12:49:05 UTC


README

It is a content management system based on the Yii3 framework that uses the Doctrine ORM. It can be customised using the Composer package manager.

Features

  • Create and manage pages, posts, and navigation.
  • Design SEO-friendly URLs.
  • Manage permissions.

Requirements

  • PHP 8.2 or higher.

How to use

  1. Create a new project from a template using the Composer package manager:
composer create-project klsoft/yii3-cms my_site
cd my_site
  1. Configure the Doctrine connection in the config/common/params.php.
  2. Set the encryptorKey parameter in the config/web/params.php.
  3. Create and initialise the database schema:
./yii init
  1. To run the application:
./yii serve

To run the application using the specified options:

./yii serve --address=127.0.0.1 --port=8080

Open your browser to the URL http://localhost:8080

If you would prefer to use a different web server, please refer to the Configuring web servers section. To achieve the best performance, use the Swoole HTTP server via the klsoft-web/yii3-swoole package.

How to use with Docker

  1. Clone the repository.
  2. Uncomment the line 'host' => 'mysql' in the config/common/params.php
  3. Set the encryptorKey parameter in the config/web/params.php.
  4. Start the application:
    docker compose up -d 
  5. Create and initialise the database schema:
    docker compose exec app ./yii init 

Open your browser to the URL http://localhost:8080

Yii3 CMS Structure

The Yii3 CMS has two default parts: public and administrative. The public part is provided by the klsoft-web/yii3-cms-site-bootstrap5 package. The administrative part is provided by the klsoft-web/yii3-cms-admin-bootstrap5 package. You can replace either of these parts using the Composer package manager. First install the new part with the composer require new-part command, then remove the old part with the composer remove old-part command.

Developing a package for the Yii3 CMS

To adjust the number of parts in the Yii3 CMS, use the['config-plugin']['routes'] parameter in the config/configuration.php file. All parts except one must include a configuration parameter key and a route prefix.

When creating a package for the Yii3 CMS, you can use the provided parameters or develop your own.

The parameters for the public part:

//config/params.php

return [
    'klsoft/yii3-cms' => [
        'routes' => [
                Group::create()
                    ->routes(
                        // ...
                    ),
        ],
        'fallbackHandler' => Reference::to(NotFoundHandler::class),
        'layout' => '@vendor/klsoft/yii3-cms-site-bootstrap5/src/Presentation/Shared/Layout/Main/layout.php',
    ],
];

You can override the ['klsoft/yii3-cms']['routes'] parameter in the config/common/yii3-cms-routes.php file, as well as the ['klsoft/yii3-cms']['fallbackHandler'] and ['klsoft/yii3-cms']['layout'] parameters in the config/web/di/application.php file.

The parameters for the administrative part:

//config/params.php

return [
    'klsoft/yii3-cms' => [
        'admin' => [
            'routes' => [
                Group::create(prefix: '/admin')
                    ->routes(
                        // ...
                    ),
        ]
    ],
];

You can override the ['klsoft/yii3-cms']['admin']['routes'] parameter in the config/common/yii3-cms-admin-routes.php file.

To develop your own set of entities, create a package and add the following configuration to the config/di.php file:

//config/di.php

use Doctrine\Persistence\Mapping\Driver\ClassLocator;
use Doctrine\Persistence\Mapping\Driver\ClassNames;

return [
    ClassLocator::class => new ClassNames(
        [
            MyEntity::class
        ]
    ),
];

Note that all parts of Yii3 CMS have to depend on the same package containing the set of entities. Use the klsoft/yii3-cms-entities package as a sample.