An open API service indexing awesome lists of open source software.

https://github.com/isaka-james/thyrus

A lightweight PHP framework designed for effortless hosting and minimal configuration.
https://github.com/isaka-james/thyrus

framework lightweight-framework php php-framework phpframework thyrus thyrus-framework thyrus-php thyrus-php-framework

Last synced: 8 months ago
JSON representation

A lightweight PHP framework designed for effortless hosting and minimal configuration.

Awesome Lists containing this project

README

          


Thyrus Framework








## Overview


since 04 Sep,2024

Thyrus is a lightweight PHP framework designed for ease of use and simplicity in deployment. It supports MVC (Model-View-Controller) architecture and is optimized for environments where you may only have limited directory access, such as free hosting platforms.

**Predecessor:** *MasterPHP (which lacked MVC architecture)*

## Features

- **Easy Hosting:** Designed to run on any PHP server without the need for complex configurations.
- **MVC Architecture:** Supports a clear separation of concerns with Model, View, and Controller.
- **Assets Management:** Includes an `assets` directory for managing static assets like CSS and images.
- **Zero Configuration:** Suitable for environments where only a partial directory is accessible.

## Directory Structure

The framework’s file structure is as follows:

```bash
├── assets
│ └── astra.css
├── astra
│ └── helpers
│ └── helpers.php
├── composer.json
├── composer.lock
├── config
│ └── database.php
├── index.php
├── routes
│ └── web.php
├── src
│ ├── Config
│ │ └── CORS.php
│ ├── Controllers
│ │ ├── Controller.php
│ │ └── TestController.php
│ ├── Database
│ │ └── DatabaseManager.php
│ ├── Models
│ │ └── BaseModel.php
│ └── Views
│ └── index.twig
└── vendor
├── autoload.php
├── composer
│ ├── ClassLoader.php
......
```

## Installation

1. **Download or Clone:**

```
git clone https://github.com/isaka-james/thyrus.git
```

2. **Navigate to the Project Directory:**

```
cd thyrus
```

3. **Install Dependencies:**

Ensure you have [Composer](https://getcomposer.org/) installed. Run:

```
composer install
```

## Configuration

1. **Database Configuration:**

Edit the `config/database.php` file to set up your database connection.

2. **Routing:**

Define your routes in the `routes/web.php` file.

## Usage

1. **Create a Controller:**

Extend the base controller class located at `src/Controllers/Controller.php`.

```php
namespace App\Controllers;

use App\Controller;

class MyController extends Controller
{
public function index()
{
return $this->render('index.twig', ['data' => 'Hello World']);
}
}
```

2. **Create a Model:**

Extend the base model class located at `src/Models/BaseModel.php`.

```php
namespace App\Models;

use App\Model;

class MyModel extends BaseModel
{
// Model methods
}
```

3. **Create a View:**

Place your Twig templates in the `src/Views` directory.

```twig
{# src/Views/index.twig #}


{{ data }}




```

## License

Thyrus is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.


since 3 August,2024