Add second argument to \Mibew\Style\StyleInterface::render

This commit is contained in:
Dmitriy Simushev 2014-01-16 10:50:48 +00:00
parent 175686aded
commit 9c0348cce3
4 changed files with 16 additions and 10 deletions

View File

@ -37,10 +37,12 @@ class ChatStyle extends Style implements StyleInterface {
/**
* Renders template file to HTML and send it to the output
*
* @param string $template_name Name of the template file without path and
* extension
* @param string $template_name Name of the template file with neither path
* nor extension.
* @param array $data Associative array of values that should be used for
* substitutions in a template.
*/
public function render($template_name) {
public function render($template_name, $data = array()) {
$templates_root = MIBEW_FS_ROOT .
'/' . $this->filesPath() . '/templates/';
$full_template_name = $template_name . '.tpl';

View File

@ -49,7 +49,7 @@ class InvitationStyle extends Style implements StyleInterface {
* The method does not contain actual code because inviation styles are not
* renderable now.
*/
public function render($template_name) {
public function render($template_name, $data = array()) {
return FALSE;
}

View File

@ -37,10 +37,12 @@ class PageStyle extends Style implements StyleInterface {
/**
* Renders template file to HTML and send it to the output
*
* @param string $template_name Name of the template file without path but
* with extension
* @param string $template_name Name of the template file with neither path
* nor extension.
* @param array $data Associative array of values that should be used for
* substitutions in a template.
*/
public function render($template_name) {
public function render($template_name, $data = array()) {
// We need to import some variables to make them visible to required
// view.
global $page, $version, $errors;

View File

@ -77,10 +77,12 @@ interface StyleInterface {
/**
* Renders template file to HTML and send it to the output
*
* @param string $template_name Name of the template file without path and
* extension.
* @param string $template_name Name of the template file with neither path
* nor extension.
* @param array $data Associative array of values that should be used for
* substitutions in a template.
*/
public function render($template_name);
public function render($template_name, $data = array());
}
?>