2017 © Pedro Peláez
 

library mvpress

MVC-style template loader for WordPress

image

ericmann/mvpress

MVC-style template loader for WordPress

  • Thursday, February 15, 2018
  • by ericmann
  • Repository
  • 3 Watchers
  • 19 Stars
  • 17 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

MVPress Build Status ![Coverage Status][coveralls-image]

MVC-style template loader for WordPress, (*1)

Installation

This module can be easily installed by adding ericmann/mvpress to your composer.json file. Then, either autoload your Composer dependencies or manually include() the mvpress.php bootstrap file., (*2)

Usage

The namespaced \MVPress\get_template_part() function is a fully backwards-compatible replacement for WordPress' default get_template_part(). At a minimum, you can use the new version as a 1:1 alternative., (*3)

However, once using the new version, you can:, (*4)

  • Pass an optional 3rd parameter to define a model object in the scope of the template.
  • Pass an optional 4th parameter to define an array of dynamic user data in the scope of the template.
  • Reference $this->model in the template directly (no globals!).
  • Reference $this->context->query in the template to access the global WP_Query object in-scope.
  • Reference $this->context->request in the template to access the global $_REQUEST object in-scope.
  • Reference $this->context->userData in the template to access the passed-in dynamic array in-scope.

Changelog

02-23-16 - 1.0.0 - Refactored as Composer module 12-13-13 - 0.1.0 - First release, (*5)

The Versions

15/02 2018

dev-master

9999999-dev

MVC-style template loader for WordPress

  Sources   Download

GPLv2+ GPL-2.0-or-later

The Development Requires

24/02 2016

1.0.0

1.0.0.0

MVC-style template loader for WordPress

  Sources   Download

GPLv2+

The Development Requires