Views extension for Mediawiki
PHP
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
README.md
Views.class.php
Views.hooks.php
Views.i18n.php
Views.php

README.md

Mediawiki-Views

Views

Views extension for Mediawiki. Brings some templating in dev process to separate html and php.

Instead of using inline html blocks in php, just use Views.

Example

  • Create folder named views in your extension folder.
  • Put some php-template in this folder, for example mytemplate.php with some content:
<div class="hello-div <?=$b?>">
<p> <?=a?> </p>
</div>
  • Call Views. To feed template with some data push array to second parameter:
$data = array( 'a' => 10, 'b' => 'hello' );
$html = Views::forge('mytemplate', $data);

Result will be stored in $html variable:

<div class="hello-div hello">
<p> 10 </p>
</div>

Thats it!