MV framework logo
  • Architecture
  • Philosophy
  • Admin panel
  • Support
  • Feedback
Documentation
Download .zip version 3.2.0 from 25.12.2024
  • Architecture
  • Philosophy
  • Admin panel
  • Support
  • Feedback
Getting started
  • Installation and launch
  • Folder structure
  • Launching a simple website
  • Pre-installed models
  • SQLite getting started
  • System settings
  • Migrations
  • Debugging
Models
  • General principles of models
  • Data types
    • General characteristics
    • Boolean
    • String char
    • Numeric: int, float, order
    • Special string: url, redirect, email, phone
    • Password
    • Text
    • Date and time
    • File and image
    • Array of images
    • Choice enum
    • Parent
    • Many to one
    • Many to many
    • Group
  • Model setup
  • Simple models
  • Foreign keys
  • Trees
  • Many to many
  • Group
  • Records management
  • Managing simple models
  • Additional features
Templates and routing
  • General principles of templates
  • Router object
  • MV object
  • Create a new template
  • Output of data in template
  • Record object
  • Files and images
  • Date and time
  • Redirects and http
  • Sending email
  • Special methods
Forms
  • Creating forms
  • Setting up form fields
  • Validating form fields
  • Form security
  • Working with form data
  • Using data from models
  • Form methods
SQL queries
  • Query builder
  • Direct queries
  • Pagination
  • Sorting
  • Filtration
Additional
  • AJAX
  • Plugins
  • Caching
  • Security
  • Admin panel add-ons
Documentation
Getting started
  • Installation and launch
  • Folder structure
  • Launching a simple website
  • Pre-installed models
  • SQLite getting started
  • System settings
  • Migrations
  • Debugging
Models
  • General principles of models
  • Data types
    • General characteristics
    • Boolean
    • String char
    • Numeric: int, float, order
    • Special string: url, redirect, email, phone
    • Password
    • Text
    • Date and time
    • File and image
    • Array of images
    • Choice enum
    • Parent
    • Many to one
    • Many to many
    • Group
  • Model setup
  • Simple models
  • Foreign keys
  • Trees
  • Many to many
  • Group
  • Records management
  • Managing simple models
  • Additional features
Templates and routing
  • General principles of templates
  • Router object
  • MV object
  • Create a new template
  • Output of data in template
  • Record object
  • Files and images
  • Date and time
  • Redirects and http
  • Sending email
  • Special methods
Forms
  • Creating forms
  • Setting up form fields
  • Validating form fields
  • Form security
  • Working with form data
  • Using data from models
  • Form methods
SQL queries
  • Query builder
  • Direct queries
  • Pagination
  • Sorting
  • Filtration
Additional
  • AJAX
  • Plugins
  • Caching
  • Security
  • Admin panel add-ons
MV tracker

General characteristics

All data types inherit from the base type represented by the ModelElement class, core/datatypes/base.type.php file and have the following additional parameters:

required
Purpose: makes this field mandatory to fill in when creating/editing a record
Possible values: true, false
Default: false

unique
Purpose: allows you to maintain unique values ​​of this field in the table when creating/editing records
Possible values: true, false
Default: false

must_match
Purpose: used in forms to ensure that the value matches the value of another (usually for passwords)
Possible values: the name of the field from this model, for example 'name', 'password'
Default: null

help_text
Purpose: text with explanations for this field in the administrative part (can also be used in site templates)
Possible values: text
Default: null

html_params
Purpose: additional html parameters for this field in the administrative interface (class, dimensions, etc.)
Possible values: text, html attributes
Default: null

For all string types, the minimum and maximum length parameters are relevant.

length
Purpose: exact required field length (in utf-8 characters)
Possible values: positive integer
Default: null

min_length
Purpose: minimum field length (in utf-8 characters)
Possible values: positive integer
Default: null

max_length
Purpose: maximum field length (in utf-8 characters)
Possible values: positive integer
Default: null

min_max_length
Purpose: minimum and maximum field length (in utf-8 characters)
Possible values: string value in the form of 2 positive integers, separated by ','
Default: null

Examples:

['Name', 'char', 'name', ['required' => true]]

['File', 'file', 'file_price', ['help_text' => 'Downloadable file in .pdf format']]

['Link', 'url', 'link', ['required' => true, 'unique' => true]]

['Text', 'text', 'content', ['html_params' => 'class="wide" id="main-content"']]

['Repeat password', 'password', 'repeat-password', ['required' => true, 'must_match' => 'new_password']]

Next section

Boolean
MV workshop banner
MV tracker

© 2014-2025, MV framework team

MV tracker project Github