Skip to content

Repository files navigation

Phalcon Tutorial

This is a small sample application for the Phalcon PHP Framework: a simple registration form built as an MVC app. It is the companion code for the Basic Tutorial documentation page and runs on both Phalcon 5 (the C extension) and Phalcon 6 (the phalcon/phalcon Composer package).

Requirements

  • PHP >= 8.1
  • Phalcon 5 (C extension) or Phalcon 6 (Composer package)
  • MySQL 8.0
  • Docker (recommended for local development)

Quick start (Docker)

cp resources/.env.example .env
docker compose up -d --build

Then open http://localhost:8080. The database schema and a seed user are loaded automatically on first boot.

To run on Phalcon 6 instead of 5, set PHALCON_VARIANT=v6 in .env (or export it) and rebuild:

PHALCON_VARIANT=v6 docker compose up -d --build

To open a shell in the app container:

docker compose exec app bash

Composer scripts

Script What it does
composer cs Check coding standard (PSR-12) with PHPCS
composer cs-fix Auto-fix coding standard with PHPCBF
composer cs-fixer Check style with PHP-CS-Fixer (dry-run)
composer cs-fixer-fix Apply PHP-CS-Fixer changes
composer analyze Static analysis with PHPStan (level 6)
composer test Run the functional smoke test (Talon)

Project layout

This project follows the PDS skeleton:

docs/        documentation
public/      web root (index.php, css)
resources/   tooling configs, docker, schema, .env.example
src/         application source (PSR-4 Tutorial\)
tests/       Talon functional test

License

The Phalcon Tutorial is open-sourced software licensed under the MIT license. © Phalcon Framework Team and contributors.

About

Phalcon Tutorial

Resources

Code of conduct

Contributing

Security policy

Stars

156 stars

Watchers

27 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages