Open main menu

Extension:Model

MediaWiki extensions manual
Crystal Clear action run.svg
Model
Release status: beta
Extension-Model.png
Implementation MyWiki
Description Brings "M" from MVC pattern
Author(s) (Vedmakatalk)
Latest version 0.1 (2013-08-25)
MediaWiki 1.17+
Database changes No
License GPL v3
Download
README
Translate the Model extension if it is available at translatewiki.net
Check usage and version matrix.

The Model extension brings "M" from MVC pattern into MediaWiki.

InstallationEdit

  • Download and place the file(s) in a directory called Model in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    require_once "$IP/extensions/Model/Model.php";
    
  •   Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

UsageEdit

Very simple and lightweight thing. Model allows you use model-objects over Mediawiki DatabaseBase class.

With Model you can focus on work with objects, not SQL-queries.

$user = new Model_User();
$user->password = '1234';
$user->save();

To start using Model:

  • include it in LocalSettings.php
  • create model classes based on class Model with your model description
  • create proper database tables
  • use models in your code.
Read the detailed documentation for additional information!