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.

2.1.0(2y ago)0261[1 issues](https://github.com/iwillhappy1314/wenprise-mvc/issues)PHPPHP &gt;=7.3

Since Jan 25Pushed 4d ago1 watchersCompare

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

READMEChangelog (10)Dependencies (8)Versions (31)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

42

—

FairBetter than 90% of packages

Maintenance65

Regular maintenance activity

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity69

Established project with proven stability

 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 ~74 days

Recently: every ~340 days

Total

30

Last Release

885d ago

Major Versions

1.4.1 → 2.0.02023-06-21

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

2.0.0PHP &gt;=7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/a0fa49958b7c45c0b373b185feb5debe5bdd35be3b3536bc44477d3bd3a2d435?d=identicon)[iwillhappy1314](/maintainers/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

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel/pulse

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

1.7k12.1M99](/packages/laravel-pulse)[themosis/framework

The Themosis framework.

676307.9k18](/packages/themosis-framework)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/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.

44643.1k1](/packages/pressbooks-pressbooks)[themosis/theme

The Themosis framework boilerplate theme.

10449.0k3](/packages/themosis-theme)

PHPackages © 2026

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