yii2-extensions/app-basic

Web Application Basic

Package info

github.com/yii2-extensions/app-basic

Type:project

pkg:composer/yii2-extensions/app-basic

Statistics

Installs: 372

Dependents: 1

Suggesters: 0

Stars: 18

Open Issues: 1

0.1.2 2025-10-08 15:17 UTC

Requires

Suggests

None

Conflicts

None

Replaces

None

BSD-3-Clause 16a5206308de5b196b56e8f103a32f2428f92509

webapplicationbasicyii2-extensions


README

๐Ÿ‘ Yii Framework

Web Application Basic


๐Ÿ‘ Codeception
๐Ÿ‘ PHPStan

A modern, Bootstrap 5-powered Yii2 application template for rapid development
Clean architecture, production-ready features, and developer-friendly configuration

๐Ÿ‘ Web Application Basic

Features

๐Ÿ‘ Feature Overview

Available deployment options

Traditional Web Servers

Classic web-server + PHP-FPM setup; simple and widely supported for deployment.

๐Ÿ‘ Apache
๐Ÿ‘ Nginx
๐Ÿ‘ FrankenPHP Classic

High-Performance Worker Mode

Long-running PHP workers for higher throughput and lower latency.

๐Ÿ‘ FrankenPHP
๐Ÿ‘ RoadRunner

Important

For setup instructions, see README.md in each branch.

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.

  1. Pre-configured structure with organized directories for assets, views, models, and controllers.
  2. Bootstrap 5 integration for responsive, mobile-first user interfaces.
  3. Security features including CSRF protection and input validation.
  4. 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.

Installation

composer create-project --prefer-dist yii2-extensions/app-basic:^0.1 app-basic
cd app-basic

Quick start

Start development server

# Using built-in PHP server
php -S localhost:8080 -t web

# Or using Yii console command
./yii serve

Important

Your application will be available at http://localhost:8080 or at the address set in --address option.

Directory structure

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

Creating your first page

<?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');
 }
}

Console commands

# Run the hello command
./yii hello/index

# Generate translations
./yii message config/messages.php

# Clear cache
./yii cache/flush-all

Package information

๐Ÿ‘ PHP
๐Ÿ‘ Yii 2.0.x
๐Ÿ‘ Yii 22.0.x
๐Ÿ‘ Latest Stable Version
๐Ÿ‘ Total Downloads

Quality code

๐Ÿ‘ Codecov
๐Ÿ‘ PHPStan Level Max
๐Ÿ‘ Super-Linter
๐Ÿ‘ StyleCI

Documentation

For detailed configuration options and advanced usage:

Our social networks

๐Ÿ‘ Follow on X

License

๐Ÿ‘ License