davidhirtz / website
Website template for yii2-cms
Requires
- php: ^8.3
- davidhirtz/yii2-cms: ^3.15
- davidhirtz/yii2-skeleton: ^3.19
- davidhirtz/yii2-vite: ^3.4
Requires (Dev)
- davidhirtz/yii2-dev: ^3.0.2
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
A website built on Yii 2 and yii2-cms: pages made of typed sections, a media library with responsive images, menus, a cookie consent banner that blocks external content until it is allowed, and an admin to edit it all.
Creating a project
composer create-project davidhirtz/website my-site
The installer asks for the project's name, the database and a preset — bare for two text section types and nothing else, or starter for nine more (hero banner, image & text, carousel, gallery, quote, call to action, accordion, teasers) and demo content. It creates the databases, writes the configuration, creates the first user and makes the "Initial commit". See installation.
Without PHP, clone this repository and run the installer and the site in Docker:
git clone https://github.com/davidhirtz/website.git my-site && cd my-site docker compose run --rm app sh installer/docker.sh docker compose up
Getting started
Requires PHP 8.3+ with imagick, MySQL or MariaDB, Composer and Node.js 20.19+.
git clone git@github.com:OWNER/REPOSITORY.git cd REPOSITORY composer install && composer install-hooks npm install php yii params && php yii migrate && php yii user/create && php yii setup YII_ENV=dev php -S localhost:8080 -t web
Sign in at http://localhost:8080/admin.
Or, with nothing but Docker, docker compose up and sign in as admin@example.com with the password website123, see
Docker.
Everyday commands
npm run dev # Vite dev server npm run build # build web/dist — commit it, the deploy does not build composer check # code style, static analysis and tests, as CI runs them composer cs-fix # fix the code style ./yii message # update the translation files
Documentation
- Installation
- Development
- The content model — including how to add a section type
- Deployment
- Cookie consent
- Agents (MCP)
- Optional bundles — Shopify products, locations
- AGENTS.md — for AI coding agents
License
Released under the MIT License.