使用UMI CMS在php模板中输出自定义函数结果

时间:2018-05-15 16:35:53

标签: php templates

我在modules / custom.php文件中创建了自定义函数,我正在尝试将其结果输出到php模板中。

public function pagetemp($template = 'default') {
    list($template_block) = emarket::loadTemplates('emarket/' . $template, 'personal_link');
    $block_arr = [];
    return emarket::parseTemplate($template_block, $block_arr);
}

但它不起作用。 如何将自定义函数的结果传递给php模板?希望我的问题有道理。