/** * 获取邮件发送模板内容 * @param $type 模板类型 * @param $info 给模板的变量 */ public function getSendBody($type, $info = false) { rc::smarty()->assign('sendemail', $type); $nowTemplatesPath = rc::smarty()->template_dir; rc::smarty()->assign('info', $info); $body = rc::smarty()->fetch('EmailAction/index-email.html'); rc::smarty()->template_dir = $nowTemplatesPath; return $body; }
<?php // +---------------------------------------------------------------------- // | RechoPHP [ WE CAN DO IT JUST Better ] // +---------------------------------------------------------------------- // | Copyright (c) 2010-2014 http://recho.net All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- // | Author: recho <*****@*****.**> // +---------------------------------------------------------------------- session_start(); header("X-Powered-By:Recho-2.0"); define('IS_IN', true); define('WWWROOT', dirname(__FILE__) . '/'); define('RECHO_PHP', WWWROOT . '../../RechoPHP/'); require_once RECHO_PHP . 'RechoPHP.php'; //-- 共用smarty数据 -- rc::smarty()->assign(array('redirectURL' => urlencode($_REQUEST['redirectURL']), 'siteInfo' => array('siteName' => C('SITENAME'), 'title' => C('TITLE')), 'siteName' => C('SITENAME'), 'WWWROOT' => C('WWWBASEURL/'), 'WWWROOT1' => C('WWWBASEURL')));
public function get($name) { return rc::smarty()->getTemplateVars($name); }