yii2-extensions / app-base
Shared Yii2 backend scaffold: models, controllers, migrations, RBAC, mail templates, and CLI.
Package info
github.com/yii2-extensions/app-base
Type:yii2-scaffold
pkg:composer/yii2-extensions/app-base
Requires
- php: >=8.3
- yii2-extensions/scaffold: ^0.1@dev
- yiisoft/yii2: ^22.0@dev
- yiisoft/yii2-symfonymailer: ^4.0
Requires (Dev)
- codeception/codeception: ^5.3
- codeception/lib-innerbrowser: ^4.1
- codeception/module-asserts: ^3.3
- codeception/module-filesystem: ^3.0
- codeception/module-yii2: ^2.0
- codeception/verify: ^3.4
- maglnet/composer-require-checker: ^4.1
- php-forge/coding-standard: ^0.1
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-strict-rules: ^2.0.3
- yii2-extensions/phpstan: ^0.4
This package is auto-updated.
Last update: 2026-04-24 01:13:42 UTC
README
App Base
Shared Yii2 backend distributed as a yii2-extensions/scaffold provider
User model, auth, RBAC, migrations, mail, console, web entrypoints.
Features
What is a scaffold provider?
app-base is not a runtime library; there is no class to extend or service to register.
It is a yii2-extensions/scaffold provider ; a package that declares a set of files to copy into a
consumer project.
On composer install, the scaffold plugin reads scaffold.json from this package and copies src/, config/, rbac/,
resources/, public/ and yii into the consumer root. Files that are marked as preserve (configs, RBAC, runtime
assets) are only written once, so your edits survive subsequent installs.
See docs/scaffold.md for the detailed walkthrough.
Requirements
- PHP
>=8.3 yiisoft/yii2^22.0@devyii2-extensions/scaffold^0.1@dev- A frontend overlay provider for views, CSS, and JS ; see docs/frontend-overlays.md.
Quick start
Create a new directory for your app, drop in this composer.json, then run composer install:
{
"name": "my-company/my-app",
"type": "project",
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=8.3",
"yii2-extensions/app-base": "^22.0@dev",
"yii2-extensions/app-jquery": "^22.0@dev"
},
"require-dev": {
"yii2-extensions/scaffold": "^0.1@dev"
},
"extra": {
"scaffold": {
"allowed-packages": [
"yii2-extensions/app-base",
"yii2-extensions/app-jquery"
]
},
"yii\\composer\\Installer::postCreateProject": {
"setPermission": [
{
"runtime": "0775",
"public/assets": "0775",
"yii": "0755"
}
]
},
"yii\\composer\\Installer::postInstall": {
"generateCookieValidationKey": [
"config/web.php"
]
}
},
"config": {
"allow-plugins": {
"yii2-extensions/scaffold": true,
"yiisoft/yii2-composer": true
}
},
"scripts": {
"post-create-project-cmd": [
"yii\\composer\\Installer::postCreateProject",
"yii\\composer\\Installer::postInstall"
],
"post-install-cmd": [
"yii\\composer\\Installer::postInstall"
]
}
}
Then:
composer install # scaffold copies the tree in + autogenerates cookieValidationKey ./yii migrate # creates the user table + admin user php -S localhost:8080 -t public public/router.php # start the dev server
Full walkthrough: docs/installation.md.
What ships
After composer install, the consumer project tree looks like this:
your-app/
├── src/
│ ├── controllers/ SiteController, UserController
│ ├── models/ User ActiveRecord + 8 form models + UserSearch
│ ├── migrations/ CreateUserTable, CreateAdminUser
│ └── commands/ HelloController (console entry-point example)
├── config/ [preserve] web.php, console.php, db.php, params.php, test.php, test_db.php
├── rbac/ [preserve] items.php, rules.php, assignments.php
├── resources/
│ ├── mail/ HTML + text templates (emailVerify, passwordResetToken) + layouts
│ └── views/ layouts/main, site/*, user/* ; rendered by the frontend overlay
├── public/ index.php, index-test.php, router.php (built-in server), assets/, images/
├── runtime/ [preserve] .gitignore (cache, logs, db.sqlite land here)
├── yii Console entry point
└── scaffold.json Provider manifest (copy paths, per-file modes)
[preserve] = scaffold writes the file once and never overwrites it on subsequent composer install runs. All other
paths are refreshed from the provider stubs unless you explicitly scaffold eject them.
Not included (by design)
- CSS, JS, widgets, and asset bundles ; owned by frontend overlays such as
yii2-extensions/app-jquery. - Server configuration (
.htaccess,nginx.conf,Caddyfile,.rr.yaml); lives in dedicatedyii2-extensions/server-*providers.
Documentation
For detailed configuration, scaffold internals, and consumer setup.
- 📚 Installation Guide
- 📦 Scaffold Workflow
- ⚙️ Configuration Reference
- 🎨 Frontend Overlays
- 🧪 Testing Guide