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.

- ✅ 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.
- ✅ Developer Tools - Debugging tools, logging, and development-friendly configurations.
- ✅ HTTP/2 & HTTP/3 Support: Native support for modern HTTP protocols with multiplexing.
- ✅ HTTPS/TLS Support - Secure your application with built-in HTTPS support.
- ✅ Modern Bootstrap 5 UI - Responsive, mobile-first design with latest Bootstrap components.
- ✅ Testing Ready - Codeception test suite with examples for functional and unit testing.
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.
Note: Also, make sure to install
npm
for frontend dependency management.
composer create-project --prefer-dist yii2-extensions/app-basic:dev-franken-php app-basic
cd app-basic
Download static cli in Linux/WSL2
curl https://frankenphp.dev/install.sh | sh
Start the server in CLI mode
./frankenphp run --config ./Caddyfile --watch
Download and start the server with Docker images
Gitbash/Windows
docker run \
-e CADDY_GLOBAL_OPTIONS="auto_https off" \
-e CADDY_SERVER_EXTRA_DIRECTIVES="tls /app/web/ssl/localhost.pem /app/web/ssl/localhost-key.pem" \
-e FRANKENPHP_CONFIG="worker ./web/index.php" \
-e SERVER_NAME="https://localhost:8443" \
-e SERVER_ROOT="./web" \
-v "//k/yii2-extensions/app-basic:/app" \
-p 8443:8443 \
-p 8443:8443/udp \
--name yii2-frankenphp-worker \
dunglas/frankenphp
Note: Paths in the example (
//k/yii2-extensions/app-basic
) are for demonstration purposes only.
Replace them with the actual path to your Yii2 project on your system.
Linux/WSL
docker run \
-e CADDY_GLOBAL_OPTIONS="auto_https off" \
-e CADDY_SERVER_EXTRA_DIRECTIVES="tls /app/web/ssl/localhost.pem /app/web/ssl/localhost-key.pem" \
-e FRANKENPHP_CONFIG="worker ./web/index.php" \
-e SERVER_NAME="https://localhost:8443" \
-e SERVER_ROOT="./web" \
-v $PWD:/app \
-p 8443:8443 \
-p 8443:8443/udp \
--name yii2-frankenphp-worker \
dunglas/frankenphp
Your application will be available at
https://localhost:8443
or at the address set in theCaddyfile
.
root/
├── config/ Configuration files
│ ├── common/ Common configuration
│ ├── console/ Console configuration
│ ├── web/ Web configuration
│ └── messages.php Translation config
├── src/
│ ├── framework/ Framework assets & resources
│ │ ├── asset/ Asset bundles
│ │ └── resource/ CSS, JS, layouts, messages
│ └── usecase/ Application use cases
│ ├── hello/ Console command example
│ └── site/ Site pages
├── tests/ Test suites
├── vendor/ Composer dependencies
└── web/ Web server document root
<?php
// src/usecase/site/SiteController.php
declare(strict_types=1);
namespace app\usecase\site;
use yii\web\Controller;
final class SiteController extends Controller
{
public function actionIndex(): string
{
return $this->render('index');
}
}
# Run the hello command
./yii hello/index
# Generate translations
./yii message config/messages.php
# Clear cache
./yii cache/flush-all
For detailed configuration options and advanced usage: