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

File and image

Purpose: adding files and images. The database stores only file paths from the project root, without the initial slash, and the files themselves are distributed across model folders in the userfiles/models/ directory.
Field type in the SQL table: char and varchar

Additional parameters:

max_size
Purpose: maximum allowed file size 
Possible values: integer value in bytes 
Default: allowed extensions are taken from the configuration file config/settings.php

allowed_extensions
Purpose: allowed file extensions 
Possible values: array of extensions like ['doc', 'docx', 'pdf'] 
Default: allowed extensions are taken from the configuration file config/settings.php

allowed_mime_types
Purpose: allowed mime file types 
Possible values: array of the form ['image/jpeg', 'image/webp', 'image/png'] 
Default: allowed extensions are taken from the configuration file config/settings.php (only for the image type)

max_width
Purpose: maximum allowed image width 
Possible values: integer value in pixels
Default: allowed extensions are taken from the configuration file config/settings.php

max_height
Purpose: maximum allowed height images 
Possible values: integer value in pixels 
Default: allowed extensions are taken from the configuration file config/settings.php

form_preview_width
Purpose: maximum allowed width of a thumbnail copy of an image (for forms)
Possible values: integer value in pixels 
Default: 150

form_preview_height
Purpose: maximum allowed height of a thumbnail copy of an image (for forms)
Possible values: integer value in pixels 
Default: 150

multiple
Purpose: ability to upload multiple files at a time (file type for forms)
Possible values: integer value, maximum number of files
Default: null

Examples:

['Product image', 'image', 'image', ['required' => true, 'max_size' => 500000]]

['Download file', 'file', 'download_file', ['help_text' => 'Company product descriptions']]

['Resume', 'file', 'resume', ['allowed_extensions' => ['txt', 'doc', 'docx']]

['Attach files', 'file', 'files', ['files_folder' => 'files_upload', 'multiple' => 5]]

Previous section

Date and time

Next section

Array of images
MV workshop banner
MV tracker

© 2014-2025, MV framework team

MV tracker project Github