PHPackages                             devstudio-rs/wpmvc - 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. devstudio-rs/wpmvc

ActiveFramework[Framework](/categories/framework)

devstudio-rs/wpmvc
==================

WPMVC

v1.0.21(2mo ago)01.1k—9.5%MITPHPPHP &gt;=7.0

Since Apr 1Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/devstudio-rs/wpmvc)[ Packagist](https://packagist.org/packages/devstudio-rs/wpmvc)[ RSS](/packages/devstudio-rs-wpmvc/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (2)Versions (25)Used By (0)

wpmvc
=====

[](#wpmvc)

App
---

[](#app)

Initialize application.

```
$config = array(
    'components' => array(
        'request' => array(
            'class' => Request::class,
        ),
    ),
);

( new App( $config ) )->init();
```

Application and it's componenets will be availavable:

```
App::$app
App::$app->request->post();
```

Models
------

[](#models)

### Post Models

[](#post-models)

```
class Event extends \wpmvc\models\Post_Model {

    public $post_type = 'event';

    // Example of custom attributes with default values.
    public $event_date     = 1707422767;
    public $event_location = 'Bratislava';

    public function registry() : array{
        return array(
            'public'             => true,
            'publicly_queryable' => true,
            'show_ui'            => true,
            ...
        );
    }

    public function registry_labels() : array {
        return array(
            'name' => __( 'Event' ),
            ...
        );
    }

}
```

Ways to use models. Set attributes, save or delete.

```
$event = Event::find_one( 24 );
$event = new Event();

$event->set_attribute( 'post_title', 'Great Event' );
$event->set_attribute( 'event_location', 'Bratislava' );

$event->set_attributes( array(
    'post_title'     => 'Great Event',
    'event_location' => 'Bratislava',
) );

$event->load( array(
    'Event' => array(
        'post_title'     => 'Great Event',
        'event_location' => 'Bratislava',
    ),
) );

$event->save();
$event->delete();
```

#### Register custom post type with post model

[](#register-custom-post-type-with-post-model)

Register custom post type using `init` WordPres action.

```
Event::register( array(
    'labels' => array(
        'name' => __( 'Events' ),
        ...
    ),
) );
```

### Taxonomy Models

[](#taxonomy-models)

```
class Event_Category extends \wpmvc\models\Taxonomy_Model {

    public $taxonomy = 'event-category';

    public function registry() : array {
        return array(
            'hierarchical'      => true,
            'public'            => true,
            'show_ui'           => true,
            'show_admin_column' => true,
            'query_var'         => true,
            'show_in_rest'      => true,
        );
    }

    public function registry_labels() : array {
        return array(
            'name' => __( 'Event Category' ),
            ...
        );
    }

    public function registry_object_type() : array {
        return array( 'event' );
    }

}
```

Search posts by taxonomy.

```
$events = Event::find()
    ->where_taxonomy( Event_Category::class, array( 'slug' => 'taxonomy_slug' ) )
    ->all();
```

Controllers
-----------

[](#controllers)

```
class Site_Controller extends \wpmvc\web\Controller {

    public function action_index() {
        // Action logic.
    }

}
```

Register controller.

```
App::$app->router->add_route( 'site', array( Site_Controller::class, 'action_index' ) );
```

The registered action will be available at `{host}/site/`.

Meta boxes
----------

[](#meta-boxes)

Defines meta box controller.

```
class Event_Options_Controller extends \wpmvc\web\Meta_Box_Controller {

    public function on_action( $model ) {
        echo View::render( 'views/events/meta-box', array(
            'model' => $model,
        ) );
    }

    public function on_save( $model ) {
        if ( $model->load( App::$app->request->post() ) ) {
            $model->save();
        }
    }

}
```

Define meta box model.

```
class Event_Options_Meta_Box extends \wpmvc\models\Meta_Box_Model {

    public $id         = 'event_options';
    public $controller = Event_Options_Controller::class;

    public function init() {
        $this->set_title( __( 'Options' ) );
    }

}
```

Add meta box model to the post model.

```
class Event extends \wpmvc\models\Post_Model {

    public $post_type = 'event';

    public function init() {
        $this->add_meta_box( Event_Options_Meta_Box::class );
    }

}
```

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance86

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

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

Recently: every ~70 days

Total

24

Last Release

72d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4865305?v=4)[Miloš Petković](/maintainers/mpetkovic)[@mpetkovic](https://github.com/mpetkovic)

---

Top Contributors

[![mpetkovic](https://avatars.githubusercontent.com/u/4865305?v=4)](https://github.com/mpetkovic "mpetkovic (92 commits)")

### Embed Badge

![Health badge](/badges/devstudio-rs-wpmvc/health.svg)

```
[![Health](https://phpackages.com/badges/devstudio-rs-wpmvc/health.svg)](https://phpackages.com/packages/devstudio-rs-wpmvc)
```

###  Alternatives

[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k39.6M299](/packages/laravel-dusk)[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)[link-cloud/fast-hyperf

LinkCloud Fast Hyperf

241.2k1](/packages/link-cloud-fast-hyperf)

PHPackages © 2026

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