yii2-extensions / app-basic
Web Application Basic
Installs: 313
Dependents: 1
Suggesters: 0
Security: 0
Stars: 13
Watchers: 1
Forks: 2
Open Issues: 2
Type:project
Requires
- php: >=8.1
- php-forge/foxy: ^0.1
- ui-awesome/html: ^0.3
- ui-awesome/html-component-bootstrap5: ^1.0@dev
- ui-awesome/html-svg: ^0.2
- yii2-extensions/localeurls: ^0.1.0
- yiisoft/yii2: ^2.0.53|^22
- yiisoft/yii2-bootstrap5: ^2.0.50|^22
- yiisoft/yii2-symfonymailer: ^4.0|^22
Requires (Dev)
- codeception/c3: ^2.8
- codeception/codeception: ^5.0.0
- codeception/lib-innerbrowser: ^4.0
- codeception/module-asserts: ^3.0
- codeception/module-filesystem: ^3.0
- codeception/module-yii2: ^1.1
- codeception/verify: ^3.0
- maglnet/composer-require-checker: ^4.6
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-strict-rules: ^2.0.3
- rector/rector: ^2.0
- symfony/browser-kit: ^6.3
- symfony/process: ^6.3
- symplify/easy-coding-standard: ^12.3
- yii2-extensions/phpstan: ^0.3.0
- yiisoft/yii2-debug: ^2.1.27|^22
- yiisoft/yii2-gii: ^2.2.7|^22
Provides
- bower-asset/bootstrap: ^5.2
- bower-asset/inputmask: 5.0.9
- bower-asset/jquery: 3.6.1
- bower-asset/punycode: ^1.4
- bower-asset/yii2-pjax: ~2.0.1
- dev-main
- dev-fix-mini-22
- dev-fix-mini-21
- dev-fix-mini-20
- dev-fix-mini-19
- dev-fix-mini-18
- dev-fix-mini-17
- dev-fix-mini-16
- dev-feat-mini-1
- dev-fix-mini-15
- dev-fix-mini-14
- dev-fix-mini-13
- dev-fix-mini-12
- dev-fix-mini-11
- dev-fix-mini-10
- dev-fix-mini-9
- dev-fix-mini-8
- dev-fix-mini-7
- dev-fix-mini-6
- dev-dependabot/composer/symfony/browser-kit-tw-7.1
- dev-dependabot/composer/symfony/process-tw-7.1
- dev-add-api-set-theme
- dev-demo-multilanguage
- dev-add-tests-selenium
This package is auto-updated.
Last update: 2025-07-11 13:38:04 UTC
README
Web Application Basic
A modern, Bootstrap 5-powered Yii2 application template designed for rapid web-application development. Built with best practices, clean architecture, and developer-friendly configuration, it lets you create production-ready apps with minimal setup while maintaining code quality and extensibility.
Features
- ✅ Asset Management - Optimized asset bundles for CSS, JS, and resource management.
- ✅ Clean Architecture - Well-organized directory structure following Yii2 best practices.
- ✅ Console Commands - Example console commands for background tasks and maintenance.
- ✅ Contact Form - Fully functional contact form with validation and email sending.
- ✅ Developer Tools - Debugging tools, logging, and development-friendly configurations.
- ✅ Modern Bootstrap 5 UI - Responsive, mobile-first design with latest Bootstrap components.
- ✅ Multi-language Support - Built-in internationalization (i18n) support with message translations.
- ✅ Ready-to-Use Pages - Pre-built pages including home, about, contact, and error handling.
- ✅ Security Features - Built-in CSRF protection, input validation, and secure configurations.
- ✅ SSL Support - Configured for secure HTTPS connections with SSL (mkcert).
- ✅ Testing Ready - Codeception test suite with examples for functional and unit testing.
Environment support
Quick start
How it works
The Yii2 Web Application Basic template provides a complete foundation for building modern web applications. Unlike starting from scratch, this template includes.
- Pre-configured structure with organized directories for assets, views, models, and controllers.
- Bootstrap 5 integration for responsive, mobile-first user interfaces.
- Security features including CSRF protection and input validation.
- Development tools for debugging, logging, and testing.
Why use this template
- Rapid development: Start building features immediately without setup overhead.
- Best practices: Follow Yii2 conventions and modern web development standards.
- Extensible: Easy to customize and extend for specific project requirements.
- Production-ready: Includes security features and optimizations for deployment.
Application structure:
Web App Basic
├── Assets (CSS, JS, Images)
├── Console (Background tasks)
├── I18n (Multi-language support)
├── Pages (Home, About, Contact, Error)
├── Security (CSRF, Validation, Authentication)
└── Testing (Unit, Functional tests)
Installation
Quick start
composer create-project --prefer-dist --stability=dev yii2-extensions/app-basic myapp
cd myapp
Start development server
# Using built-in PHP server php -S localhost:8080 -t public # Or using Yii console command ./yii serve
Start Apache or Nginx server
# For Apache docker-compose up -d # For FrankenPHP docker-compose -f docker-compose.frankenphp.yml up -d # For Nginx docker-compose -f docker-compose.nginx.yml up -d
Access your application
After starting the server, you can access your application in your web browser.
# For built-in PHP server http://localhost:8080/ # For Apache http://localhost:8080/ # For FrankenPHP http://localhost:8081/ # For Nginx http://localhost:8082/
Basic usage
Directory structure
root/
├── config/ Configuration files
│ ├── common/ Common configuration
│ ├── console/ Console configuration
│ ├── web/ Web configuration
│ └── messages.php Translation config
├── docker/ Docker configuration files
│ ├── apache/ Apache configuration
│ ├── frankenphp/ FrankenPHP configuration
│ ├── nginx/ Nginx configuration
│ └── php/ PHP configuration
├── src/
│ ├── framework/ Framework assets & resources
│ │ ├── asset/ Asset bundles
│ │ ├── event/ Event handlers
│ │ └── resource/ CSS, JS, layouts, messages
│ └── usecase/ Application use cases
│ ├── contact/ Contact functionality
│ ├── hello/ Console command example
│ ├── security/ Security features
│ └── site/ Site pages
├── tests/ Test suites
├── vendor/ Composer dependencies
└── public/ Web server document root
Creating your first page
<?php // src/usecase/site/SiteController.php declare(strict_types=1); namespace app\usecase\site; use yii\web\Controller; class SiteController extends Controller { public function actionIndex(): string { return $this->render('index'); } public function actionAbout(): string { return $this->render('about'); } }
Console commands
# Run the hello command ./yii hello/index # Generate translations ./yii message config/messages.php # Clear cache ./yii cache/flush-all
Quality code
Documentation
For detailed configuration options and advanced usage:
Screenshots
The web application includes these ready-to-use pages:
- Home Page - Welcome page with navigation
- About Page - Information about your application
- Contact Page - Contact form with validation
- 404 Error Page - Custom error handling