PHPackages                             mvccore/ext-modelform - 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. mvccore/ext-modelform

ActiveLibrary[Framework](/categories/framework)

mvccore/ext-modelform
=====================

MvcCore - Extension - ModelForm - extension to build forms by decorated model classes.

v5.3.2(1mo ago)03091BSD-3-ClausePHPPHP &gt;=5.4.0

Since Feb 12Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/mvccore/ext-modelform)[ Packagist](https://packagist.org/packages/mvccore/ext-modelform)[ RSS](/packages/mvccore-ext-modelform/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (6)Versions (44)Used By (1)

MvcCore - Extension - ModelForm
===============================

[](#mvccore---extension---modelform)

[![Latest Stable Version](https://camo.githubusercontent.com/5fcf6c8c4db95d05267ef89b6fcdcd252a231aa0e69eae48a6c0e5aefcd5f8e6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f537461626c652d76352e332e322d627269676874677265656e2e7376673f7374796c653d706c6173746963)](https://github.com/mvccore/ext-modelform/releases)[![License](https://camo.githubusercontent.com/53baed538c1c87a033a212f6f4acce684d36137f8622307643ab25e08118452e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d425344253230332d627269676874677265656e2e7376673f7374796c653d706c6173746963)](https://mvccore.github.io/docs/mvccore/5.0.0/LICENSE.md)[![PHP Version](https://camo.githubusercontent.com/9e923690739211296a00adce5d359999dfa345f80fc1b2e2cfe72c49523ee334/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d2533453d352e342d627269676874677265656e2e7376673f7374796c653d706c6173746963)](https://camo.githubusercontent.com/9e923690739211296a00adce5d359999dfa345f80fc1b2e2cfe72c49523ee334/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d2533453d352e342d627269676874677265656e2e7376673f7374796c653d706c6173746963)

MvcCore form extension to build forms by decorated model classes.

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

[](#installation)

```
composer require mvccore/ext-modelform
```

Features
--------

[](#features)

- Simply creating form instance with fields by decorated model properties
    without extending `\MvcCore\Ext\Form` or \\MvcCore\\Ext\\ModelForms\\Form` class.
- Possibility to get model properties metadata by `\MvcCore\Ext\ModelForms\IModel::GetFormsMetaData()`.
- Model properties decoration by PHP 8+ attributes or by PHP Docs tags in older PHP versions.
- Possibility to decorate model property by any MvcCore form field with field options.
- Possibility to decorate options loader for fields with options like Select or other...
- Possibility to decorate model property by any MvcCore form validator(s) or by multiple validators with it's options.
- Possibility to decorate local validation method for any field, validation method
    could be placed in form, controller or model as instance or static method, method context is configurable.
- Possibility to extend model form or it's protected methods to customize fields initiatization.

Basic Example
-------------

[](#basic-example)

### PHP &gt;= 8 With Attributes Decorations

[](#php--8-with-attributes-decorations)

#### Bootstrap.php

[](#bootstrapphp)

```
