Yee CMS Core
More info: Advanced Application Template Installation.
- Installing (using Composer)
If you do not have [Composer](http://getcomposer.org/), follow the instructions in the
[Installing Yii](https://github.com/yiisoft/yii2/blob/master/docs/guide/start-installation.md#installing-via-composer) section of the definitive guide to install it.
With Composer installed, you can then install the application using the following commands:
```bash
cd /var/www/
composer global require "fxp/composer-asset-plugin:~1.0.0"
composer create-project --prefer-dist yiisoft/yii2-app-advanced mysite.com
```
-
Initialize the installed application
Execute the
init
command and selectdev
as environment.cd /var/www/mysite.com/ php init
-
Configurate your web server:
-
For Apache config file could be the following:
<VirtualHost *:80> ServerName mysite.com ServerAlias www.mysite.com DocumentRoot "/var/www/mysite.com/" <Directory "/var/www/mysite.com/"> AllowOverride All </Directory> </VirtualHost>
-
Create
.htaccess
file in the root folder with following content:# prevent directory listings Options -Indexes RewriteEngine on RewriteCond %{REQUEST_URI} ^/admin/$ RewriteRule ^(admin)/$ /$1 [R=301,L] RewriteCond %{REQUEST_URI} ^/admin RewriteRule ^admin(/.+)?$ /backend/web/$1 [L,PT] RewriteCond %{REQUEST_URI} ^.*$ RewriteRule ^(.*)$ /frontend/web/$1
-
Create
.htaccess
file inbackend/web/
andfrontend/web/
folders with following content:RewriteEngine on # if a directory or a file exists, use the request directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # otherwise forward the request to index.php RewriteRule . index.php
-
-
Create a new database and adjust the
components['db']
configuration incommon/config/main-local.php
accordingly. -
Apply migrations with console command
php yii migrate
.
#####Your yii2-app-advanced
application is installed. Visit your site, the site should work and message Congratulations! You have successfully created your Yii-powered application should be displayed.
-
Update
frontend/config/main.php
file:add
'homeUrl' => '/',
and
'components' => [ 'request' => [ 'baseUrl' => '', ], ]
and
'components' => [ 'urlManager' => [ 'class' => 'yii\web\UrlManager', 'showScriptName' => false, 'enablePrettyUrl' => true, 'rules' => array( '<module:auth>/<action:\w+>' => '<module>/default/<action>', '<action:\w+>' => 'site/<action>', '<controller:\w+>/<action:\w+>' => '<controller>/<action>', ) ], ]
-
Update
backend/config/main.php
file:add
'homeUrl' => '/admin',
and
'components' => [ 'request' => [ 'baseUrl' => '/admin', ], ]
and
'components' => [ 'urlManager' => [ 'class' => 'yii\web\UrlManager', 'showScriptName' => false, 'enablePrettyUrl' => true, 'rules' => array( '<module:\w+>/' => '<module>/default/index', '<module:\w+>/<action:\w+>/<id:\d+>' => '<module>/default/<action>', '<module:\w+>/<action:(create)>' => '<module>/default/<action>', '<module:\w+>/<controller:\w+>' => '<module>/<controller>/index', '<module:\w+>/<controller:\w+>/<action:\w+>/<id:\d+>' => '<module>/<controller>/<action>', '<module:\w+>/<controller:\w+>/<action:\w+>' => '<module>/<controller>/<action>', '<controller:\w+>/<id:\d+>' => '<controller>/view', '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>', '<controller:\w+>/<action:\w+>' => '<controller>/<action>', ) ], ]
-
Set
minimum-stability
todev
and add"prefer-stable": true
in/var/www/mysite.com/composer.json
-
Install
yeesoft/yii2-yee-core
module-
Run this command:
composer require --prefer-dist yeesoft/yii2-yee-core "*"
-
Apply migrations:
yii migrate --migrationPath=@vendor/yeesoft/yii2-yee-core/migrations/
-
Remove
['components']['user']
setting fromfrontend/config/main.php
andbackend/config/main.php
configurations. -
Add
['components']['user']
and['modules']['yee']
setting incommon/config/main.php
:'components' => [ 'user' => [ 'class' => 'yeesoft\components\User', 'on afterLogin' => function($event) { \yeesoft\models\UserVisitLog::newVisitor($event->identity->id); } ], ]
'modules' => [ 'yee' => [ 'class' => 'yeesoft\Yee', ], ],
-
-
Set the same value for
['components']['request']['cookieValidationKey']
infrontend/config/main-local.php
andbackend/config/main-local.php
. This is necessary for correct working of cookie-based login. -
Configurate your mailer
['components']['mailer']
incommon/config/main-local.php
. -
Update backend controller:
- Replace
backend/controllers/SiteController.php
content by this:namespace backend\controllers; use yeesoft\controllers\admin\BaseController; class SiteController extends BaseController { public function actionIndex() { return $this->render('index'); } }
- Replace
#####Yee CMS Core is installed! Now you can sign up on the site. After registration you can set superadmin
field to 1
in user
table to enable super administrator rights for your user. Now log in on the site and visit http://yoursite.com/admin
, empty control panel should be displayed. You can create your own Yee modules or install existing to extend the functionality of Yee CMS.
- Install Yee Auth Module
- Install Yee Settings Module
- Install Yee Menu Module
- Install Yee User Module
- Install Yee Media Module
- Install Yee Post Module
- Install Yee Page Module
- Install Comments Module
- Install Yee Comments Module
- Install Gii Generator For Yee