本文整理汇总了PHP中Tpl类的典型用法代码示例。如果您正苦于以下问题:PHP Tpl类的具体用法?PHP Tpl怎么用?PHP Tpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Tpl类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: pic_cutOp
/**
* 图片裁剪
*
*/
public function pic_cutOp()
{
Uk86Language::uk86_read('admin_common');
$lang = Uk86Language::uk86_getLangContent();
uk86_import('function.thumb');
if (uk86_chksubmit()) {
$thumb_width = $_POST['x'];
$x1 = $_POST["x1"];
$y1 = $_POST["y1"];
$x2 = $_POST["x2"];
$y2 = $_POST["y2"];
$w = $_POST["w"];
$h = $_POST["h"];
$scale = $thumb_width / $w;
$src = str_ireplace(UPLOAD_SITE_URL, BASE_UPLOAD_PATH, $_POST['url']);
if (strpos($src, '..') !== false || strpos($src, BASE_UPLOAD_PATH) !== 0) {
exit;
}
if (!empty($_POST['filename'])) {
// $save_file2 = BASE_UPLOAD_PATH.'/'.$_POST['filename'];
$save_file2 = str_ireplace(UPLOAD_SITE_URL, BASE_UPLOAD_PATH, $_POST['filename']);
} else {
$save_file2 = str_replace('_small.', '_sm.', $src);
}
$cropped = uk86_resize_thumb($save_file2, $src, $w, $h, $x1, $y1, $scale);
@unlink($src);
$pathinfo = pathinfo($save_file2);
exit($pathinfo['basename']);
}
$save_file = str_ireplace(UPLOAD_SITE_URL, BASE_UPLOAD_PATH, $_GET['url']);
$_GET['resize'] = $_GET['resize'] == '0' ? '0' : '1';
Tpl::output('height', uk86_get_height($save_file));
Tpl::output('width', uk86_get_width($save_file));
Tpl::showpage('common.pic_cut', 'null_layout');
}
开发者ID:wangjiang988,项目名称:ukshop,代码行数:39,代码来源:common.php
示例2: newTemplateFromFile
public static function newTemplateFromFile($path)
{
$tpl = new Tpl($path);
$tpl->setDirectories(static::$_directories);
$tpl->setVarFunctions(static::$_functions);
$tpl->setIgnoreNotFoundBlocs(static::$_ignoreNotFoundBlocs);
return $tpl;
}
开发者ID:bixev,项目名称:light-html-template,代码行数:8,代码来源:Factory.php
示例3: generate_graminfo_files
function generate_graminfo_files($outDir)
{
$tpl = new Tpl(dirname(__FILE__) . '/tpl');
$storage_ary = array('File', 'Mem', 'Shm');
$tpl = new Tpl(dirname(__FILE__) . '/tpl');
$helper_class = "Helper";
foreach ($storage_ary as $storage_name) {
$storage_class = "StorageHelper_" . ucfirst($storage_name);
$helper = new $helper_class($tpl, new $storage_class());
$result = $tpl->get('graminfo', array('helper' => $helper));
$file_name = "{$outDir}/graminfo_" . strtolower($storage_name) . '.php';
file_put_contents($file_name, $result);
unset($helper);
}
}
开发者ID:bendasvadim,项目名称:NewsModxBox,代码行数:15,代码来源:gen.php
示例4: pic_cutOp
/**
* 图片裁剪
*
*/
public function pic_cutOp()
{
import('function.thumb');
if (chksubmit()) {
$thumb_width = $_POST['x'];
$x1 = $_POST["x1"];
$y1 = $_POST["y1"];
$x2 = $_POST["x2"];
$y2 = $_POST["y2"];
$w = $_POST["w"];
$h = $_POST["h"];
$scale = $thumb_width / $w;
$src = str_ireplace(UPLOAD_SITE_URL, BASE_UPLOAD_PATH, $_POST['url']);
if (strpos($src, '..') !== false || strpos($src, BASE_UPLOAD_PATH) !== 0) {
exit;
}
$save_file2 = str_replace('_small.', '_sm.', $src);
$cropped = resize_thumb($save_file2, $src, $w, $h, $x1, $y1, $scale);
@unlink($src);
$pathinfo = pathinfo($save_file2);
exit($pathinfo['basename']);
} else {
Language::read('cut');
$lang = Language::getLangContent();
}
$save_file = str_ireplace(UPLOAD_SITE_URL, BASE_UPLOAD_PATH, $_GET['url']);
$_GET['x'] = intval($_GET['x']) > 50 && $_GET['x'] < 400 ? $_GET['x'] : 200;
$_GET['y'] = intval($_GET['y']) > 50 && $_GET['y'] < 400 ? $_GET['y'] : 200;
$_GET['resize'] = $_GET['resize'] == '0' ? '0' : '1';
Tpl::output('height', get_height($save_file));
Tpl::output('width', get_width($save_file));
Tpl::showpage('cut', 'null_layout');
}
开发者ID:flying3615,项目名称:chuniang,代码行数:37,代码来源:cut.php
示例5: indexOp
/**
* 分类列表
*/
public function indexOp()
{
Language::read('home_category_index');
$lang = Language::getLangContent();
//得到分类类型
$type = trim($_GET['type']);
switch ($type) {
case 'store':
$model_sc = Model('store_class');
$sc_list = $model_sc->getTreeList();
//导航
$nav_link = array('0' => array('title' => $lang['homepage'], 'link' => SiteUrl . '/index.php'), '1' => array('title' => $lang['category_index_store_class']));
$model_store = Model('store');
//推荐店铺
$recommend_store = $model_store->getRecommendStore(5);
Tpl::output('recommend_store', $recommend_store);
//最新店铺
$new_store = $model_store->getNewStore(5);
Tpl::output('new_store', $new_store);
Tpl::output('nav_link_list', $nav_link);
Tpl::output('sc_list', $sc_list);
Tpl::showpage('category_store');
break;
default:
//导航
$nav_link = array('0' => array('title' => $lang['homepage'], 'link' => SiteUrl . '/index.php'), '1' => array('title' => $lang['category_index_goods_class']));
//分类
$show_goods_class = ($g = F('goods_class')) ? $g : H('goods_class', true, 'file');
Tpl::output('nav_link_list', $nav_link);
Tpl::output('gc_list', $show_goods_class);
Tpl::output('html_title', C('site_name') . ' - ' . Language::get('category_index_goods_class'));
Tpl::showpage('category_goods');
break;
}
}
开发者ID:my1977,项目名称:shopnc,代码行数:38,代码来源:category.php
示例6: profile_menu
/**
* 用户中心右边,小导航
*
* @param string $menu_type 导航类型
* @param string $menu_key 当前导航的menu_key
* @return
*/
private function profile_menu($menu_key = '')
{
Language::read('member_layout');
$menu_array = array(1 => array('menu_key' => 'store_printsetup', 'menu_name' => '打印设置', 'menu_url' => 'index.php?act=store_printsetup&op=index'));
Tpl::output('member_menu', $menu_array);
Tpl::output('menu_key', $menu_key);
}
开发者ID:noikiy,项目名称:nc-1,代码行数:14,代码来源:store_printsetup.php
示例7: profile_menu
/**
* 用户中心右边,小导航
*
* @param string $menu_key 当前导航的menu_key
* @return
*/
private function profile_menu($menu_key = '')
{
$menu_array = array();
$menu_array[] = array('menu_key' => 'log_list', 'menu_name' => '日志列表', 'menu_url' => urlShop('seller_log', 'log_list'));
Tpl::output('member_menu', $menu_array);
Tpl::output('menu_key', $menu_key);
}
开发者ID:noikiy,项目名称:cunkou,代码行数:13,代码来源:seller_log.php
示例8: indexOp
public function indexOp()
{
Language::read('home_index_index');
Tpl::output('index_sign', 'index');
$model_setting = Model('setting');
$setting = $model_setting->getListSetting();
//抢购专区
if (intval($setting['groupbuy_allow']) == 1) {
Language::read('member_groupbuy');
$model_groupbuy = Model('groupbuy');
$group_list = $model_groupbuy->getGroupbuyCommendedList(1);
Tpl::output('group_list', $group_list);
}
//限时折扣
if (intval($setting['promotion_allow']) == 1) {
$model_xianshi_goods = Model('p_xianshi_goods');
$xianshi_item = $model_xianshi_goods->getXianshiGoodsCommendList(2);
Tpl::output('xianshi_item', $xianshi_item);
}
//板块信息
//$model_web_config = Model('web_config');
$model_web_config = Model('web_config');
// dev_end
$web_html = $model_web_config->getWebHtml('index');
Tpl::output('web_html', $web_html);
// Dev: 品牌信息
$model_brand = Model('brand');
$condition = 'brand_apply=1 and brand_pic IS NOT NULL AND TRIM(brand_pic) <> \'\'';
$brand_list = $model_brand->where($condition)->limit(6)->select();
Tpl::output('brand_list', $brand_list);
// Dev_end
Model('seo')->type('index')->show();
Tpl::showpage('index');
}
开发者ID:noikiy,项目名称:shopnc-minion,代码行数:34,代码来源:index.php
示例9: mb_appOp
/**
* 设置下载地址
*
*/
public function mb_appOp()
{
$model_setting = Model('setting');
$mobile_apk = $model_setting->getRowSetting('mobile_apk');
$mobile_content = $model_setting->getRowSetting('mobile_content');
$mobile_apk_version = $model_setting->getRowSetting('mobile_apk_version');
$mobile_ios = $model_setting->getRowSetting('mobile_ios');
if (chksubmit()) {
$update_array = array();
$update_array['mobile_apk'] = $_POST['mobile_apk'];
$update_array['mobile_apk_version'] = intval($_POST['mobile_apk_version']);
$update_array['mobile_content'] = $_POST['mobile_content'];
$update_array['mobile_ios'] = $_POST['mobile_ios'];
$state = $model_setting->updateSetting($update_array);
if ($state) {
$this->log('设置手机端下载地址');
showMessage(Language::get('nc_common_save_succ'), 'index.php?act=mb_app&op=mb_app');
} else {
showMessage(Language::get('nc_common_save_fail'));
}
}
Tpl::output('mobile_apk', $mobile_apk);
Tpl::output('mobile_version', $mobile_apk_version);
Tpl::output('mobile_ios', $mobile_ios);
Tpl::output('mobile_content', $mobile_content);
Tpl::showpage('mb_app.edit');
}
开发者ID:Maplecms,项目名称:shopnc-api,代码行数:31,代码来源:mb_app.php
示例10: editOp
/**
* 编辑
*/
public function editOp()
{
$model_payment = Model('payment');
if (chksubmit()) {
$payment_id = intval($_POST["payment_id"]);
$data = array();
$data['payment_state'] = intval($_POST["payment_state"]);
$payment_config = '';
$config_array = explode(',', $_POST["config_name"]);
//配置参数
if (is_array($config_array) && !empty($config_array)) {
$config_info = array();
foreach ($config_array as $k) {
$config_info[$k] = trim($_POST[$k]);
}
$payment_config = serialize($config_info);
}
$data['payment_config'] = $payment_config;
//支付接口配置信息
$model_payment->editPayment($data, array('payment_id' => $payment_id));
showMessage(Language::get('nc_common_save_succ'), 'index.php?act=payment&op=index');
}
$payment_id = intval($_GET["payment_id"]);
$payment = $model_payment->getPaymentInfo(array('payment_id' => $payment_id));
if ($payment['payment_config'] != '') {
Tpl::output('config_array', unserialize($payment['payment_config']));
}
Tpl::output('payment', $payment);
Tpl::showpage('payment.edit');
}
开发者ID:noikiy,项目名称:shopnc-minion,代码行数:33,代码来源:payment.php
示例11: indexOp
/**
* 店铺开店页
*
*/
public function indexOp()
{
Language::read("home_login_index");
$code_info = C('store_joinin_pic');
$info['pic'] = array();
if (!empty($code_info)) {
$info = unserialize($code_info);
}
Tpl::output('pic_list', $info['pic']);
//首页图片
Tpl::output('show_txt', $info['show_txt']);
//贴心提示
$model_help = Model('help');
$condition['type_id'] = '1';
//入驻指南
$help_list = $model_help->getHelpList($condition, '', 4);
//显示4个
Tpl::output('help_list', $help_list);
Tpl::output('article_list', '');
//底部不显示文章分类
Tpl::output('show_sign', 'joinin');
Tpl::output('html_title', C('site_name') . ' - ' . '商家入驻');
Tpl::setLayout('store_joinin_layout');
Tpl::showpage('store_joinin');
}
开发者ID:xuxuecheng,项目名称:shopnc,代码行数:29,代码来源:show_joinin.php
示例12: returnOp
/**
* 支付回调
*/
public function returnOp()
{
$verify_result = $this->_verify_result('return');
if ($verify_result) {
//商户订单号
$out_trade_no = $_GET['out_trade_no'];
//支付宝交易号
$trade_no = $_GET['trade_no'];
//支付接口代码
$payment_code = 'alipay';
//验证成功
$model_order = Model('order');
$model_payment = Model('payment');
$order_list = $model_order->getOrderList(array('pay_sn' => $out_trade_no, 'order_state' => ORDER_STATE_NEW));
$result = $model_payment->updateProductBuy($out_trade_no, $payment_code, $order_list, $trade_no);
if (empty($result['error'])) {
Tpl::output('result', 'success');
Tpl::output('message', '支付成功');
} else {
Tpl::output('result', 'fail');
Tpl::output('message', '支付失败');
}
} else {
//验证失败
//如要调试,请看alipay_notify.php页面的verifyReturn函数
Tpl::output('result', 'fail');
Tpl::output('message', '支付失败');
}
Tpl::showpage('payment_message');
}
开发者ID:noikiy,项目名称:haifenbao,代码行数:33,代码来源:payment.php
示例13: pointvoucherOp
/**
* 所有卡卷包
*/
public function pointvoucherOp()
{
$model = Model('voucher_template');
//查询条件
$condition = array();
$condition['voucher_t_start_date'] = array('lt', time());
$condition['voucher_t_end_date'] = array('gt', time());
$condition['voucher_t_state'] = 1;
$condition['voucher_t_total'] = array('gt', 'voucher_t_giveout');
//排序
if ($_GET['order_type'] == 1 || empty($_GET['order_type'])) {
$order = 'voucher_t_recommend desc, voucher_t_start_date desc';
} elseif ($_GET['order_type'] == 2) {
$order = 'voucher_t_giveout desc';
} else {
if ($_GET['order'] == 'asc') {
$order = 'voucher_t_points asc';
} else {
$order = 'voucher_t_points desc';
}
}
$field = 'voucher_t_id, voucher_t_end_date, voucher_t_price, voucher_t_points, voucher_t_limit, voucher_t_title, voucher_t_customimg';
$voucher_list = $model->where($condition)->field($field)->order($order)->select();
Tpl::output('list', $voucher_list);
Tpl::showpage('ucoin.index');
}
开发者ID:wangjiang988,项目名称:ukshop,代码行数:29,代码来源:wap_UCoin.php
示例14: indexOp
public function indexOp()
{
$model_store = Model('store');
$model_store_bind_class = Model('store_bind_class');
$model_store_class = Model('store_class');
$model_store_grade = Model('store_grade');
// 店铺信息
$store_info = $model_store->getStoreInfoByID($_SESSION['store_id']);
Tpl::output('store_info', $store_info);
// 店铺分类信息
$store_class_info = $model_store_class->getOneClass($store_info['sc_id']);
Tpl::output('store_class_name', $store_class_info['sc_name']);
// 店铺等级信息
$store_grade_info = $model_store_grade->getOneGrade($store_info['grade_id']);
Tpl::output('store_grade_name', $store_grade_info['sg_name']);
$model_store_joinin = Model('store_joinin');
$joinin_detail = $model_store_joinin->getOne(array('member_id' => $store_info['member_id']));
Tpl::output('joinin_detail', $joinin_detail);
$store_bind_class_list = $model_store_bind_class->getStoreBindClassList(array('store_id' => $_SESSION['store_id']), null);
$goods_class = H('goods_class') ? H('goods_class') : H('goods_class', true);
for ($i = 0, $j = count($store_bind_class_list); $i < $j; $i++) {
$store_bind_class_list[$i]['class_1_name'] = $goods_class[$store_bind_class_list[$i]['class_1']]['gc_name'];
$store_bind_class_list[$i]['class_2_name'] = $goods_class[$store_bind_class_list[$i]['class_2']]['gc_name'];
$store_bind_class_list[$i]['class_3_name'] = $goods_class[$store_bind_class_list[$i]['class_3']]['gc_name'];
}
Tpl::output('store_bind_class_list', $store_bind_class_list);
Tpl::showpage('store_info');
}
开发者ID:noikiy,项目名称:nc-1,代码行数:28,代码来源:store_info.php
示例15: resources_manageOp
/**
* cms设置
*/
public function resources_manageOp()
{
$model_setting = Model('setting');
$setting_list = $model_setting->getListSetting();
Tpl::output('setting', $setting_list);
Tpl::showpage('resources_manage');
}
开发者ID:ff00x0,项目名称:shopnc-api,代码行数:10,代码来源:resources_manage.php
示例16: indexOp
/**
* Apply to be a management
*/
public function indexOp()
{
// Circle information
$this->circleInfo();
// Membership information
$this->circleMemberInfo();
// Members to join the circle list
$this->memberJoinCircle();
$model = Model();
$mapply_list = $model->table('circle_mapply')->where(array('circle_id' => $this->c_id))->page(10)->order('mapply_id desc')->select();
if (!empty($mapply_list)) {
$memberid_array = array();
$mapply_array = array();
foreach ($mapply_list as $val) {
$memberid_array[] = $val['member_id'];
$mapply_array[$val['member_id']] = $val;
}
$member_list = $model->table('circle_member')->field('cm_level,cm_levelname,member_id,member_name')->where(array('circle_id' => $this->c_id, 'member_id' => array('in', $memberid_array)))->select();
$mapply_list = array();
if (!empty($member_list)) {
foreach ($member_list as $val) {
$mapply_list[$val['member_id']] = array_merge($val, $mapply_array[$val['member_id']]);
}
}
Tpl::output('mapply_list', $mapply_list);
Tpl::output('show_page', $model->showpage(2));
}
$this->sidebar_menu('managerapply');
Tpl::showpage('group_manage_mapply');
}
开发者ID:dotku,项目名称:shopnc_cnnewyork,代码行数:33,代码来源:manage_mapply.php
示例17: returnOp
/**
* 支付回调
*/
public function returnOp()
{
unset($_GET['act']);
unset($_GET['op']);
unset($_GET['payment_code']);
$payment_api = $this->_get_payment_api();
$payment_config = $this->_get_payment_config();
$callback_info = $payment_api->getReturnInfo($payment_config);
if ($callback_info) {
//验证成功
$result = $this->_update_order($callback_info['out_trade_no'], $callback_info['trade_no']);
if ($result['state']) {
Tpl::output('result', 'success');
Tpl::output('message', '支付成功');
} else {
Tpl::output('result', 'fail');
Tpl::output('message', '支付失败');
}
} else {
//验证失败
Tpl::output('result', 'fail');
Tpl::output('message', '支付失败');
}
Tpl::showpage('payment_message');
}
开发者ID:ff00x0,项目名称:shopnc,代码行数:28,代码来源:payment.php
示例18: indexOp
/**
* 店铺帮助页
*
*/
public function indexOp()
{
$model_help = Model('help');
$list = $model_help->getShowStoreHelpList();
$type_id = intval($_GET['t_id']);
//帮助类型编号
if ($type_id < 1 || empty($list[$type_id])) {
$type_array = current($list);
$type_id = $type_array['type_id'];
}
Tpl::output('type_id', $type_id);
$help_id = intval($_GET['help_id']);
//帮助编号
if ($help_id < 1 || empty($list[$type_id]['help_list'][$help_id])) {
$help_array = current($list[$type_id]['help_list']);
$help_id = $help_array['help_id'];
}
Tpl::output('help_id', $help_id);
$help = $list[$type_id]['help_list'][$help_id];
Tpl::output('list', $list);
//左侧帮助类型及帮助
Tpl::output('help', $help);
//当前帮助
Tpl::output('article_list', '');
//底部不显示首页的文章分类
$phone_array = explode(',', C('site_phone'));
Tpl::output('phone_array', $phone_array);
Tpl::output('html_title', C('site_name') . ' - ' . '商家帮助指南');
Tpl::setLayout('store_joinin_layout');
Tpl::showpage('store_help');
}
开发者ID:mengtaolin,项目名称:shopping,代码行数:35,代码来源:show_help.php
示例19: modifypwOp
/**
* 修改密码
*/
public function modifypwOp()
{
if (chksubmit()) {
if (trim($_POST['new_pw']) !== trim($_POST['new_pw2'])) {
//showMessage('两次输入的密码不一致,请重新输入');
showMessage(Language::get('index_modifypw_repeat_error'));
}
$admininfo = $this->getAdminInfo();
//查询管理员信息
$admin_model = Model('admin');
$admininfo = $admin_model->getOneAdmin($admininfo['id']);
if (!is_array($admininfo) || count($admininfo) <= 0) {
showMessage(Language::get('index_modifypw_admin_error'));
}
//旧密码是否正确
if ($admininfo['admin_password'] != md5(trim($_POST['old_pw']))) {
showMessage(Language::get('index_modifypw_oldpw_error'));
}
$new_pw = md5(trim($_POST['new_pw']));
$result = $admin_model->updateAdmin(array('admin_password' => $new_pw, 'admin_id' => $admininfo['admin_id']));
if ($result) {
showMessage(Language::get('index_modifypw_success'));
} else {
showMessage(Language::get('index_modifypw_fail'));
}
} else {
Language::read('admin');
Tpl::showpage('admin.modifypw');
}
}
开发者ID:flying3615,项目名称:chuniang,代码行数:33,代码来源:index.php
示例20: indexOp
/**
* 编辑信息
*/
public function indexOp()
{
$model_dp = Model('delivery_point');
$dpoint_info = $model_dp->getDeliveryPointFailInfo(array('dlyp_id' => $_SESSION['dlyp_id']));
Tpl::output('dpoint_info', $dpoint_info);
Tpl::showpage('joinin_again', 'login_layout');
}
开发者ID:mengtaolin,项目名称:shopping,代码行数:10,代码来源:joinin_again.php
注:本文中的Tpl类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论