PHPackages                             tsirosgeorge/semantic - 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. tsirosgeorge/semantic

ActiveProject[Framework](/categories/framework)

tsirosgeorge/semantic
=====================

A simple PHP framework for building web applications.

v1.0.4(1y ago)015mitCSS

Since Sep 1Pushed 1y ago1 watchersCompare

[ Source](https://github.com/tsirosgeorge/semantic-mvc)[ Packagist](https://packagist.org/packages/tsirosgeorge/semantic)[ RSS](/packages/tsirosgeorge-semantic/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (5)Used By (0)

Semantic MVC Framework
======================

[](#semantic-mvc-framework)

Welcome to the Semantic MVC Framework! This project is a custom MVC framework using FastRoute for routing and is intended for internal use. It includes features like a `View` class for rendering HTML views and basic authentication.

Installation
------------

[](#installation)

To install the Semantic MVC Framework, use Composer:

```
composer create-project tsirosgeorge/semantic
```

How to Use
----------

[](#how-to-use)

1. **Configuration**

    After installation, rename the file `.env.example` to `.env` and add your configuration settings.
2. **Rendering Views**

    To render data in your view pages, use the `View::render` method. For example:

    ```
    View::render('login', $data, 'auth');
    ```

- The first parameter is the view page name.
- The second parameter is the data to pass to the view.
- The third parameter is the layout to use.

Inside your view files, you can use placeholders like `{{your_value}}`. These placeholders will be replaced with the corresponding values from the data array you provide. Ensure that the placeholders match the keys in your data array.

Routing
-------

[](#routing)

When defining routes, use the following conventions:

- **API Routes**: Prefix API routes with `api/`.
- **Page Routes**: Do not use a prefix for regular page routes.
- **Group Routes**: Use with prefix. See exmaple below.

### Example

[](#example)

Here is an example of how routes are defined in `public/index.php`:

To add protected routes, simply include `'auth'` as the last parameter in the route definition.

You can also use gropu routing with prefixes

```
router->group([], function ($router) {
    $router->addRoute('GET', '/', 'AuthController@showLoginForm');

    $router->group(['middleware' => 'auth'], function ($router) {
        $router->addRoute('GET', '/dashboard', 'DashboardController@index');
        $router->addRoute('GET', '/dashboard/members', 'DashboardController@members');
        $router->addRoute('GET', '/dashboard/b2binterest', 'DashboardController@b2binterest');
    });
});

// Group for API Routes
$router->group(['prefix' => '/api'], function ($router) {
    // Auth Routes
    $router->addRoute('GET', '/logout', 'AuthController@logout');
    $router->addRoute('POST', '/login', 'AuthController@login');
    $router->addRoute('POST', '/register', 'AuthController@register');
    $router->addRoute('GET', '/refresh-session', 'AuthController@refreshSession');

    $router->group(['middleware' => 'auth'], function ($router) {
        $router->addRoute('GET', '/dashboard/data', 'DashboardController@loadData');
        $router->addRoute('POST', '/b2binterest', 'api\B2BInterestController@create');
        $router->addRoute('PUT', '/b2binterest/{id}', 'api\B2BInterestController@update');
    });
});

In this example:

- Routes without the `api/` prefix are used for regular page requests.
- Routes with the `api/` prefix are designated for API requests.
- To protect a route, add `'auth'` as the third parameter. This indicates that the route requires authentication or add it on a group with name middleware as the example
```

License
-------

[](#license)

This project is licensed under a MIT license agreement. The full terms of the license can be found in the [LICENSE](LICENSE) file.

Changelog
---------

[](#changelog)

All notable changes to this project will be documented in the [CHANGELOG.md](CHANGELOG.md) file.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

4

Last Release

608d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3fbfab0211bb82a8bcb5f7590e081d4433ab21b689ee66cc59874ae8eeee2018?d=identicon)[tsirosgeorge](/maintainers/tsirosgeorge)

---

Top Contributors

[![tsirosgeorge](https://avatars.githubusercontent.com/u/142738816?v=4)](https://github.com/tsirosgeorge "tsirosgeorge (38 commits)")

### Embed Badge

![Health badge](/badges/tsirosgeorge-semantic/health.svg)

```
[![Health](https://phpackages.com/badges/tsirosgeorge-semantic/health.svg)](https://phpackages.com/packages/tsirosgeorge-semantic)
```

###  Alternatives

[doppar/framework

The Doppar Framework

366.7k8](/packages/doppar-framework)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
