PHPackages                             wenprise/mvc - 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. wenprise/mvc

ActiveLibrary[Framework](/categories/framework)

wenprise/mvc
============

wenprise mvc framework.

13.0.0(1mo ago)0266[1 issues](https://github.com/iwillhappy1314/wenprise-mvc/issues)PHPPHP ^8.3

Since Jan 25Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/iwillhappy1314/wenprise-mvc)[ Packagist](https://packagist.org/packages/wenprise/mvc)[ RSS](/packages/wenprise-mvc/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (10)Dependencies (16)Versions (32)Used By (0)

Wenprise MVC framework for WrodPress
====================================

[](#wenprise-mvc-framework-for-wrodpress)

Add a MVC framework to wordpress, based on [Themosis Framework](https://framework.themosis.com/) .

Usage
-----

[](#usage)

### Prerequisites

[](#prerequisites)

1. Set permalink structure as `/%postname%/` in Permalink Settings
2. Set *Your homepage displays* as `Your latest posts` in Reading Settings

### User composer to install

[](#user-composer-to-install)

In your theme directory

```
$ composer require wenprise/mvc
```

add psr-4 autoload rule to composer.json

```
"autoload": {
    "psr-4": {
      "Theme\\": "app/"
    }
},
```

the run the `dump-autoload` command

```
$ composer dump-autoload
```

### Include the autoload and frame init fie to your theme`s `functions.php` file.

[](#include-the-autoload-and-frame-init-fie-to-your-themes-functionsphp-file)

```
require_once( get_theme_file_path( 'vendor/autoload.php' ) );
require_once( get_theme_file_path( 'app/init.php' ) );
```

The directory structure
-----------------------

[](#the-directory-structure)

The structure of theme/app directory.

```
├── Controllers
│   ├── AccountController.php
├── Models
│   ├── Order.php
├── Providers
│   └── RoutingService.php
├── init.php
└── routes.php
```

Boot the framework in theme
---------------------------

[](#boot-the-framework-in-theme)

the code in `init.php`

```
namespace Theme;

use Theme\Providers\RoutingService;
use Wenprise\Mvc\App;

class Init
{

    public function __construct()
    {
        $GLOBALS[ 'wenprise' ] = App::instance();

        /*
         * 获取服务容器
         */
        $container = $GLOBALS[ 'wenprise' ]->container;

        /*
         * 注册主题视图路径
         */
        $container[ 'view.finder' ]->addLocation(get_theme_file_path('templates'));

        /*
         * 加载配置文件
         */
        $container[ 'config.finder' ]->addPaths([
            get_theme_file_path('app/Config/'),
        ]);

        /**
         * 主题服务提供者
         */
        $providers = [
            RoutingService::class,
        ];

        foreach ($providers as $provider) {
            $container->register($provider);
        }
    }

}
```

Routing Service
---------------

[](#routing-service)

the code in `RoutingService.php`

```
namespace Theme\Providers;

use Wenprise\Facades\Route;
use Wenprise\Foundation\ServiceProvider;

class RoutingService extends ServiceProvider {
	public function register() {
		Route::group( [
			'namespace' => 'Theme\Controllers',
		], function () {
			require get_theme_file_path( 'app/routes.php' );
		} );
	}
}
```

Routers
-------

[](#routers)

the code in `routes.php`

```
Route::prefix( 'account' )->group( function () {
	Route::match( [ 'get', 'post' ], 'register', 'AccountController@register' );
} );
```

Controller
----------

[](#controller)

Sampel Controller

```
namespace Theme\Controllers;

use Wenprise\Route\BaseController;

class AccountController extends BaseController {

	/**
	 * User register controller
	 * @return string
	 */
	public function register() {

	}

}
```

Models
------

[](#models)

See: [Wenprise Eloquent](https://github.com/iwillhappy1314/wenprise-eloquent)

Views
-----

[](#views)

See  or

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance90

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity89

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 98.9% 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 ~101 days

Recently: every ~559 days

Total

31

Last Release

49d ago

Major Versions

1.4.1 → 2.0.02023-06-21

2.1.0 → 13.0.02026-05-14

PHP version history (3 changes)1.0PHP &gt;=5.6.4

2.0.0PHP &gt;=7.3

13.0.0PHP ^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1455683?v=4)[Amos Lee](/maintainers/iwillhappy1314)[@iwillhappy1314](https://github.com/iwillhappy1314)

---

Top Contributors

[![iwillhappy1314](https://avatars.githubusercontent.com/u/1455683?v=4)](https://github.com/iwillhappy1314 "iwillhappy1314 (92 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

frameworkwordpresswenprise

### Embed Badge

![Health badge](/badges/wenprise-mvc/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M341](/packages/psalm-plugin-laravel)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45444.2k1](/packages/pressbooks-pressbooks)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M125](/packages/roots-acorn)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M129](/packages/laravel-pulse)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M179](/packages/laravel-ai)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M135](/packages/laravel-mcp)

PHPackages © 2026

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