PHPackages                             eyo/fw-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. eyo/fw-php

ActiveProject[Framework](/categories/framework)

eyo/fw-php
==========

EyoPHP - Educational PHP framework with permissions system, dynamic routing and middleware

0.1.9(9mo ago)020MITPHPPHP &gt;=8.1

Since Aug 6Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/APlouzeau/framework-php)[ Packagist](https://packagist.org/packages/eyo/fw-php)[ RSS](/packages/eyo-fw-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (14)Used By (0)

🚀 EyoPHP Framework
==================

[](#-eyophp-framework)

> A minimalist PHP framework that gets you from zero to working web app in 5 minutes

[![Latest Version](https://camo.githubusercontent.com/7df2735146f7ad2f140a1dd36d5a6b847c52b9fade6200c4b2d328541a9d064e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f65796f2f66772d7068702e737667)](https://packagist.org/packages/eyo/fw-php)[![License](https://camo.githubusercontent.com/4f030fb173bd35b7c7cd0682bc6a069910eec8870b94ac7d2494657910d20baf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f65796f2f66772d7068702e737667)](https://packagist.org/packages/eyo/fw-php)

> 🇫🇷 **Note for French learners**: This framework was created by a French developer for educational purposes. While documentation is in English for international reach, you'll find extensive French comments in the code and detailed French tutorials in the `/docs` folder.

⚡ Quick Start
-------------

[](#-quick-start)

Get a working web application in 2 commands:

```
# Choose your installation mode by project name:
composer create-project eyo/fw-php my-app-complete    # Full features
composer create-project eyo/fw-php my-app-minimal     # Lightweight
composer create-project eyo/fw-php my-app             # Interactive choice

cd my-app && php -S localhost:8000 -t public
```

Open  → You have a working app with authentication! 🎉

📦 Installation
--------------

[](#-installation)

### 🧠 Smart Installation (Auto-detects from project name)

[](#-smart-installation-auto-detects-from-project-name)

**⚡ Minimal Mode** - Just add `-minimal` to your project name:

```
composer create-project eyo/fw-php blog-minimal
composer create-project eyo/fw-php api-minimal
composer create-project eyo/fw-php myapp-minimal
```

**📚 Complete Mode** - Add `-complete` to your project name:

```
composer create-project eyo/fw-php cms-complete
composer create-project eyo/fw-php website-complete
composer create-project eyo/fw-php myapp-complete
```

**🤔 Interactive Choice** - Use any other name:

```
composer create-project eyo/fw-php myproject
# Will ask you to choose between Complete/Minimal modes
```

### 🔧 Change Mode Later

[](#-change-mode-later)

```
cd myproject
php scripts/setup.php minimal    # Switch to minimal
php scripts/setup.php complete   # Switch to complete
```

### 🌍 Advanced: Environment Variables (Optional)

[](#-advanced-environment-variables-optional)

```
EYOPHP_MODE=minimal composer create-project eyo/fw-php my-project
EYOPHP_MODE=complete composer create-project eyo/fw-php my-project
```

### Alternative Installation Methods

[](#alternative-installation-methods)

**Option 2: Add to Existing Project**

```
composer require eyo/fw-php
```

**Option 3: Git Clone**

```
git clone https://github.com/APlouzeau/framework-php.git my-project
cd my-project
composer install
```

⚙️ Configuration
----------------

[](#️-configuration)

### 1. Environment Setup

[](#1-environment-setup)

```
# Copy the environment template
cp .env.example .env

# Edit your database credentials
# .env
DB_HOST=localhost
DB_NAME=my_project
DB_USER=root
DB_PSW=your_password
```

### 2. Database Setup

[](#2-database-setup)

```
# Import the provided SQL schema
mysql -u root -p addPublicRoute('GET', BASE_URL . 'about', 'Controller', 'method');     // Anyone can access
$router->addUserRoute('GET', BASE_URL . 'profile', 'Controller', 'method');    // Logged users only
$router->addAdminRoute('GET', BASE_URL . 'admin', 'Controller', 'method');     // Admins only
```

### **Input Validation**

[](#input-validation)

```
// Validate user registration
$validator = new Validator($_POST);
$validator->required('email')->email()
          ->required('password')->minLength(8)
          ->required('name')->minLength(2);

if ($validator->isValid()) {
    // Process registration
}
```

### **Template System**

[](#template-system)

```
// src/Controller/AppController.php - Real method
public function homePage(): void
{
    $this->renderView('home', [
        'title' => 'Welcome to EyoPHP',
        'message' => 'Your framework is ready!'
    ]);
}
```

🚀 Usage Examples
----------------

[](#-usage-examples)

### Creating a New Controller

[](#creating-a-new-controller)

```
