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
  • 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
  • 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

Admin panel add-ons

Creating your own pages

To create your own page in the admin panel, you need to:

  1. In the customs/adminpanel/ folder, create a php file with a name that will then go into the URL (without the extension), for example, mypage.php.
  2. Now this page will be available at the link /adminpanel/custom?view=mypage.
  3. To go to this page, you usually need to add a button or link to the model page, for this you need to create a file, for example, pages-index-bottom.php, as described in the section Model settings inserting code into the administrative interface.
  4. Connect the upper and lower parts of the admin template in the mypage.php file, as in the example below. The structure of HTML tags inside may be different, for example, to split the page into columns, you can take the structure of tags from another page of the admin panel.
//File customs/adminpanel/mypage.php

<?
include Registry::get('IncludeAdminPath').'includes/header.php';
?>
<div id='columns-wrapper'>
    <div id='model-form'>
        <div class='column-inner'>
            <h3 class='column-header'>Mypage</h3>
 
            //Page contents
 
            <input type='button' class='button-light' value='Button 1' />
            <input type='button' class='button-dark' value='Button 2' onclick='...' />
        </div>
    </div>
</div>
<?
include Registry::get('IncludeAdminPath').'includes/footer.php';
?>

Model objects can be created through classes. All properties of the Registry object described in the section System settings are available, and additional properties may also be needed.

  • AdminPanelPath - URL path from the server root to the project's administrative panel, on a production server usually /adminpanel/
  • IncludeAdminPath - path from the file system root to the administrative panel folder to include files
//Calling objects of the required models
$products = new Products();
$catalogs = new Catalogs();
$producers = new Producers();

//Checking user rights to this model
//Parameters: 'create', 'read', 'update', 'delete'
$system -> user -> extraCheckModelRights('products', 'update');

Previous section

Security
MV workshop banner
MV tracker

© 2014-2025, MV framework team

MV tracker project Github