Extension:Model
Appearance
This extension is currently not actively maintained! Although it may still work, any bug reports or feature requests will more than likely be ignored. If you are interested in taking on the task of developing and maintaining this extension, you can request repository ownership. As a courtesy, you may want to contact the author. You should also remove this template and list yourself as maintaining the extension in the page's {{Extension }} infobox. |
Model Release status: unmaintained |
|
---|---|
Implementation | MyWiki |
Description | Brings "M" from MVC pattern |
Author(s) | (Vedmakatalk) |
Latest version | 0.1 (2013-08-25) |
Compatibility policy | Snapshots releases along with MediaWiki. Master is not backward compatible. |
MediaWiki | |
Database changes | No |
License | GNU General Public License 3.0 |
Download | README |
Quarterly downloads | 0 |
Translate the Model extension if it is available at translatewiki.net | |
The Model extension brings "M" from MVC pattern into MediaWiki.
Installation
[edit]- Download and move the extracted
Model
folder to yourextensions/
directory.
Developers and code contributors should install the extension from Git instead, using:cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Model - Add the following code at the bottom of your LocalSettings.php file:
require_once "$IP/extensions/Model/Model.php";
- Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Usage
[edit]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!