當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Tpl類代碼示例

本文整理匯總了PHP中Tpl的典型用法代碼示例。如果您正苦於以下問題:PHP Tpl類的具體用法?PHP Tpl怎麽用?PHP Tpl使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Tpl類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的Tpl類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。