ustadev / yii2basic
Yii 2 Basic Project Template. This project is being developed by Jamshidbek Akhlidinov
Installs: 29
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=7.4.0
- ext-json: *
- alexantr/yii2-elfinder: ^1.8
- alexantr/yii2-tinymce: ^1.0
- kartik-v/yii2-widget-depdrop: ^1.0.6
- kartik-v/yii2-widget-select2: ^2.2
- rmrevin/yii2-fontawesome: 2.10.*
- ustadev/telegram: dev-main
- ustadev/velzon-template: ^1.0.0
- ustadev/yii2-lottie-player: ^1.0
- vlucas/phpdotenv: ^5.6
- yiisoft/yii2: ~2.0.49
- yiisoft/yii2-authclient: ^2.2
- yiisoft/yii2-bootstrap5: ~2.0.2
- yiisoft/yii2-swiftmailer: ~2.1
- yiisoft/yii2-symfonymailer: ~2.0.3
Requires (Dev)
- codeception/codeception: ^5.0.0 || ^4.0
- codeception/lib-innerbrowser: ^4.0 || ^3.0 || ^1.1
- codeception/module-asserts: ^3.0 || ^1.1
- codeception/module-filesystem: ^3.0 || ^2.0 || ^1.1
- codeception/module-yii2: ^1.1
- codeception/verify: ^3.0 || ^2.2
- phpunit/phpunit: ~9.5.0
- symfony/browser-kit: ^6.0 || >=2.7 <=4.2.4
- yiisoft/yii2-debug: ~2.1.0
- yiisoft/yii2-faker: ~2.0.0
- yiisoft/yii2-gii: ~2.2.0
This package is auto-updated.
Last update: 2024-12-17 10:48:37 UTC
README
Yii 2 Basic Project Template
Yii 2 Basic Project Template is a skeleton Yii 2 application best for rapidly creating small projects.
The template contains the basic features including user login/logout and a contact page. It includes all commonly used configurations that would allow you to focus on adding new features to your application.
DIRECTORY STRUCTURE
- yii2basic
|
|-----assets/ contains assets definition
|----- commands/ contains console commands (controllers)
|----- config/ contains application configurations
|----- controllers/ contains Web controller classes
|----- mail/ contains view files for e-mails
|----- models/ contains model classes
|----- modules/ contains admin module and others modules
| |- admin/ admin module
| | |- modules/
| |-- content/ post,page,post category
| |-- file/ file management
| |-- landing element/ frontend view management
| |-- rbac/
| |- restapi/ rest api module
| modules/
| v1/
|----- runtime/ contains files generated during runtime
|----- tests/ contains various tests for the basic application
|----- vendor/ contains dependent 3rd-party packages
|----- views/ contains view files for the Web application
web/ contains the entry script and Web resources
REQUIREMENTS
The minimum requirement by this project template that your Web server supports PHP 7.4.
INSTALLATION
Install via Composer
If you do not have Composer, you may install it by following the instructions at getcomposer.org.
You can then install this project template using the following command:
composer create-project ustadev/yii2basic
Now you should be able to access the application through the following URL, assuming basic
is the directory
directly under the Web root.
http://localhost/basic/web/
Install from an Archive File
Extract the archive file downloaded from yiiframework.com to
a directory named basic
that is directly under the Web root.
Set cookie validation key in config/web.php
file to some random secret string:
'request' => [ // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation 'cookieValidationKey' => '<secret random string goes here>', ],
You can then access the application through the following URL:
http://localhost/basic/web/
CONFIGURATION
Database
config/db.php
copy config/db_locale.php
and setting this file
return [ 'class' => 'yii\db\Connection', 'dsn' => 'mysql:host=localhost;dbname=yii2basic', 'username' => 'root', 'password' => 'rooot', 'charset' => 'utf8mb4', ];
or .env.dist
file copy .env
file and settings
YII_DEBUG="true" YII_ENV="dev" APP_NAME="Admin Panel" DB_DSN="mysql:host=localhost;dbname=yii2basic" DB_USERNAME="root" DB_PASSWORD="root" DB_CHARSET="utf8mb4" BOT_TOKEN="token" MAIL_FROM_EMAIL="mail@gmail.com" MAIL_FROM_NAME="Name" MAIL_HOST="smtp.gmail.com" MAIL_PASSWORD="password"
NOTES:
- Yii won't create the database for you, this has to be done manually before you can access it.
- Check and edit the other files in the
config/
directory to customize your application as required. - Refer to the README in the
tests
directory for information specific to basic application tests.
Runing project
php yii serve
php8.1 yii serve