Skip to content

Commit 2f3ffac

Browse files
authored
Merge pull request #28 from justcoded/develop
Renamed View render() method to include(), added params
2 parents 4a29497 + 693f4e9 commit 2f3ffac

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

framework/Web/View.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ class View {
2424
*/
2525
public $template;
2626

27+
/**
28+
* Template params, which you can use to pass variables through inherited templates.
29+
*
30+
* @var array
31+
*/
32+
public $params = array();
33+
2734
/**
2835
* View constructor.
2936
*
@@ -64,7 +71,7 @@ public function __toString() {
6471
/**
6572
* Start loading theme template.
6673
*/
67-
public function include_template() {
74+
public function run() {
6875
// add alias.
6976
$template = $this->template;
7077

@@ -158,7 +165,7 @@ public function footer_begin( $name = null ) {
158165
*
159166
* @return bool
160167
*/
161-
public function render( $view, $params = array(), $__required = true ) {
168+
public function include( $view, $params = array(), $__required = true ) {
162169
$template = $this->locate( $view, $__required );
163170
if ( empty( $template ) ) {
164171
return false;

readme.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ To upgrade remove the old plugin folder. After than follow the installation step
9191

9292
== Changelog ==
9393

94-
= Version 2.1.0 - 5 January 2017 =
95-
* New: Updated View component and layouts wrapping rendering. Replaced layout_open()/layout_close() methods with extends() method.
94+
= Version 2.1.1 - 10 January 2017 =
95+
* New: Updated View component and layouts wrapping rendering. Replaced `layout_open()`/`layout_close()` methods with `extends()` method. Renamed `render()` method to `include()`
9696
* New: Moved Model meta getter methods to separate Postmeta and Termmeta objects.
9797
= Version 2.0.1 - 27 November 2017 =
9898
* New: Removed theme hooks to patch WordPress-generated .htaccess (moved to starter package)

wordpress-theme-framework.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Plugin Name: WordPress Theme Framework
55
Description: Lightweight theme framework base with Model-View concept for developers who want to better organize their own custom themes.
66
Tags: mvc theme, theme boilerplate, oop theme, mini framework
7-
Version: 2.1.0
7+
Version: 2.1.1
88
Author: JustCoded / Alex Prokopenko
99
Author URI: http://justcoded.com/
1010
License: GPL3

0 commit comments

Comments
 (0)