• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP TPL类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中TPL的典型用法代码示例。如果您正苦于以下问题:PHP TPL类的具体用法?PHP TPL怎么用?PHP TPL使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了TPL类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: loader

 private static function loader($class_name)
 {
     $require_file = AWS_PATH . preg_replace('#_+#', '/', $class_name) . '.php';
     if (file_exists($require_file)) {
         $class_file_location = $require_file;
     } else {
         if (class_exists('AWS_APP', false)) {
             self::$aliases = array_merge(self::$aliases, AWS_APP::plugins()->model());
         }
         if (isset(self::$aliases[$class_name])) {
             $class_file_location = self::$aliases[$class_name];
         } else {
             if (file_exists(ROOT_PATH . 'models/' . str_replace(array('_class', '_'), array('', '/'), $class_name) . '.php')) {
                 $class_file_location = ROOT_PATH . 'models/' . str_replace(array('_class', '_'), array('', '/'), $class_name) . '.php';
             } else {
                 if (file_exists(AWS_PATH . 'class/' . $class_name . '.inc.php')) {
                     $class_file_location = AWS_PATH . 'class/' . $class_name . '.inc.php';
                 }
             }
         }
     }
     if ($class_file_location) {
         require $class_file_location;
         self::$loaded_class[$class_name] = $class_file_location;
         if ($class_name == 'TPL') {
             TPL::initialize();
         }
         return true;
     }
 }
开发者ID:chenruixuan,项目名称:wecenter,代码行数:30,代码来源:autoload.php


示例2: entry

 public static function entry($args) {
     
     if( count($args) > 1 ) echo 404;
     else{
         
         $post  = ModelHandler::get("Posts", array($args[0]));
         $post = $post[0];
         $content = ViewHandler::wrap("post", $post);            
         $tpl = new TPL();
         $tpl->assign("content",$content);
         $tpl->draw("main");
         
     }
     
 }
开发者ID:neronmoon,项目名称:Veronica,代码行数:15,代码来源:Posts.controller.php


示例3: afterOAuth

 /**
  * 返回页面
  */
 public function afterOAuth($mpid, $page, $openid)
 {
     $page = $this->model('app\\merchant\\page')->byId($page);
     \TPL::assign('title', $page->title);
     \TPL::output('/app/merchant/shelf');
     exit;
 }
开发者ID:ahmatjan,项目名称:xinxintong,代码行数:10,代码来源:shelf.php


示例4: service_group_list_action

 public function service_group_list_action()
 {
     $this->crumb(AWS_APP::lang()->_t('客服组管理'), 'admin/ticket/service_group_list/');
     TPL::assign('groups_list', $this->model('account')->get_user_group_list(2, 2));
     TPL::assign('menu_list', $this->model('admin')->fetch_menu_list(403));
     TPL::output('admin/ticket/service_group_list');
 }
开发者ID:elelianghh,项目名称:wecenter,代码行数:7,代码来源:ticket.php


示例5: singleton

 public static function singleton()
 {
     require_once SYS_ROOT . "/smarty/Smarty.class.php";
     if (!isset(self::$instance)) {
         self::$instance = new Smarty();
         self::$instance->use_sub_dirs = true;
         //防止没有第一次使用的时候,无法连接数据库
         if (file_exists(dirname(dirname(__FILE__)) . '/config.php')) {
             $view_dir = daocall('setting', 'get', array('view_dir'));
         }
         if (!$view_dir) {
             $view_dir = 'default';
         }
         self::$instance->template_dir = APPLICATON_ROOT . '/view/' . $view_dir;
         self::$instance->compile_dir = SYS_ROOT . '/templates_c/' . $view_dir;
         if (!defined(TPL_ROOT)) {
             //define(TPL_ROOT,dirname($_SERVER["REQUEST_URI"]));
             define(TPL_ROOT, dirname($_SERVER['PHP_SELF']));
         }
         self::$instance->assign("STATIC", TPL_ROOT . '/view/' . $view_dir . '/');
         //self::$instance->assign("PSTATIC","/");
         //self::$instance->assign('role',getRoles());
         //self::$instance->caching = false;
         self::$instance->left_delimiter = '{{';
         self::$instance->right_delimiter = '}}';
     }
     return self::$instance;
 }
开发者ID:srdc2014,项目名称:vhms,代码行数:28,代码来源:tpl.php


示例6: index_action

 public function index_action()
 {
     if ($_GET['tag']) {
         $this->crumb(AWS_APP::lang()->_t('标签') . ': ' . $_GET['tag'], '/favorite/tag-' . $_GET['tag']);
     }
     //边栏可能感兴趣的人或话题
     if (TPL::is_output('block/sidebar_recommend_users_topics.tpl.htm', 'favorite/index')) {
         $recommend_users_topics = $this->model('module')->recommend_users_topics($this->user_id);
         TPL::assign('sidebar_recommend_users_topics', $recommend_users_topics);
     }
     if ($action_list = $this->model('favorite')->get_item_list($_GET['tag'], $this->user_id, calc_page_limit($_GET['page'], get_setting('contents_per_page')))) {
         foreach ($action_list as $key => $val) {
             $item_ids[] = $val['item_id'];
         }
         TPL::assign('list', $action_list);
     } else {
         if (!$_GET['page'] or $_GET['page'] == 1) {
             $this->model('favorite')->remove_favorite_tag(null, null, $_GET['tag'], $this->user_id);
         }
     }
     if ($item_ids) {
         $favorite_items_tags = $this->model('favorite')->get_favorite_items_tags_by_item_id($this->user_id, $item_ids);
         TPL::assign('favorite_items_tags', $favorite_items_tags);
     }
     TPL::assign('favorite_tags', $this->model('favorite')->get_favorite_tags($this->user_id));
     TPL::assign('pagination', AWS_APP::pagination()->initialize(array('base_url' => get_js_url('/favorite/tag-' . $_GET['tag']), 'total_rows' => $this->model('favorite')->count_favorite_items($this->user_id, $_GET['tag']), 'per_page' => get_setting('contents_per_page')))->create_links());
     TPL::output('favorite/index');
 }
开发者ID:Gradven,项目名称:what3.1.7,代码行数:28,代码来源:main.php


示例7: index_action

 public function index_action()
 {
     if (!$this->user_id) {
         HTTP::redirect('/explore/');
     }
     if (!$this->user_info['email']) {
         HTTP::redirect('/account/complete_profile/');
     }
     // 边栏可能感兴趣的人或话题
     if (TPL::is_output('block/sidebar_recommend_users_topics.tpl.htm', 'home/index')) {
         $recommend_users_topics = $this->model('module')->recommend_users_topics($this->user_id);
         TPL::assign('sidebar_recommend_users_topics', $recommend_users_topics);
     }
     // 边栏热门用户
     if (TPL::is_output('block/sidebar_hot_users.tpl.htm', 'home/index')) {
         $sidebar_hot_users = $this->model('module')->sidebar_hot_users($this->user_id);
         TPL::assign('sidebar_hot_users', $sidebar_hot_users);
     }
     $this->crumb(AWS_APP::lang()->_t('动态'), '/home/');
     TPL::import_js('js/app/index.js');
     if ($_GET['first_login']) {
         TPL::import_js('js/ajaxupload.js');
     }
     TPL::output('home/index');
 }
开发者ID:chenruixuan,项目名称:wecenter,代码行数:25,代码来源:main.php


示例8: index_action

 /**
  * 走马灯抽奖页面
  */
 public function index_action($aid)
 {
     $app = $this->model('app\\enroll')->byId($aid);
     \TPL::assign('enroll', $app);
     \TPL::output('/op/enroll/lottery');
     exit;
 }
开发者ID:ahmatjan,项目名称:xinxintong,代码行数:10,代码来源:lottery.php


示例9: search_result_action

 public function search_result_action()
 {
     if (!in_array($_GET['search_type'], array('questions', 'topics', 'users', 'articles'))) {
         $_GET['search_type'] = null;
     }
     $search_result = $this->model('search')->search(cjk_substr($_GET['q'], 0, 64), $_GET['search_type'], $_GET['page'], get_setting('contents_per_page'), null, $_GET['is_recommend']);
     if ($this->user_id and $search_result) {
         foreach ($search_result as $key => $val) {
             switch ($val['type']) {
                 case 'questions':
                     $search_result[$key]['focus'] = $this->model('question')->has_focus_question($val['search_id'], $this->user_id);
                     break;
                 case 'topics':
                     $search_result[$key]['focus'] = $this->model('topic')->has_focus_topic($this->user_id, $val['search_id']);
                     break;
                 case 'users':
                     $search_result[$key]['focus'] = $this->model('follow')->user_follow_check($this->user_id, $val['search_id']);
                     break;
             }
         }
     }
     TPL::assign('search_result', $search_result);
     if (is_mobile()) {
         TPL::output('m/ajax/search_result');
     } else {
         TPL::output('search/ajax/search_result');
     }
 }
开发者ID:wenyinos,项目名称:wecenter,代码行数:28,代码来源:ajax.php


示例10: view_action

 /**
  * 设置页面参数
  */
 public function view_action($path)
 {
     $features = $this->model('mp\\mpaccount')->getFeatures($this->mpid);
     \TPL::assign('can_member_card', $features->can_member_card);
     \TPL::assign('can_member_checkin', $features->can_member_checkin);
     parent::view_action($path);
 }
开发者ID:ahmatjan,项目名称:xinxintong,代码行数:10,代码来源:member.php


示例11: list_action

 public function list_action()
 {
     if ($this->is_post()) {
         foreach ($_POST as $key => $val) {
             if ($key == 'start_date' or $key == 'end_date') {
                 $val = base64_encode($val);
             }
             if ($key == 'keyword' or $key == 'user_name') {
                 $val = rawurlencode($val);
             }
             $param[] = $key . '-' . $val;
         }
         H::ajax_json_output(AWS_APP::RSM(array('url' => get_js_url('/admin/article/list/' . implode('__', $param))), 1, null));
     }
     $where = array();
     if ($_GET['keyword']) {
         $where[] = "(`title` LIKE '%" . $this->model('article')->quote($_GET['keyword']) . "%')";
     }
     if ($_GET['start_date']) {
         $where[] = 'add_time >= ' . strtotime(base64_decode($_GET['start_date']));
     }
     if ($_GET['end_date']) {
         $where[] = 'add_time <= ' . strtotime('+1 day', strtotime(base64_decode($_GET['end_date'])));
     }
     if ($_GET['user_name']) {
         $user_info = $this->model('account')->get_user_info_by_username($_GET['user_name']);
         $where[] = 'uid = ' . intval($user_info['uid']);
     }
     if ($_GET['comment_count_min']) {
         $where[] = 'comments >= ' . intval($_GET['comment_count_min']);
     }
     if ($_GET['answer_count_max']) {
         $where[] = 'comments <= ' . intval($_GET['comment_count_max']);
     }
     if ($articles_list = $this->model('article')->fetch_page('article', implode(' AND ', $where), 'id DESC', $_GET['page'], $this->per_page)) {
         $search_articles_total = $this->model('article')->found_rows();
     }
     if ($articles_list) {
         foreach ($articles_list as $key => $val) {
             $articles_list_uids[$val['uid']] = $val['uid'];
         }
         if ($articles_list_uids) {
             $articles_list_user_infos = $this->model('account')->get_user_info_by_uids($articles_list_uids);
         }
         foreach ($articles_list as $key => $val) {
             $articles_list[$key]['user_info'] = $articles_list_user_infos[$val['uid']];
         }
     }
     $url_param = array();
     foreach ($_GET as $key => $val) {
         if (!in_array($key, array('app', 'c', 'act', 'page'))) {
             $url_param[] = $key . '-' . $val;
         }
     }
     TPL::assign('pagination', AWS_APP::pagination()->initialize(array('base_url' => get_js_url('/admin/article/list/') . implode('__', $url_param), 'total_rows' => $search_articles_total, 'per_page' => $this->per_page))->create_links());
     $this->crumb(AWS_APP::lang()->_t('文章管理'), 'admin/article/list/');
     TPL::assign('articles_count', $search_articles_total);
     TPL::assign('list', $articles_list);
     TPL::output('admin/article/list');
 }
开发者ID:wenyinos,项目名称:wecenter,代码行数:60,代码来源:article.php


示例12: loadConfig

 public static function loadConfig()
 {
     //SQL::exec("INSERT INTO [config]p ([key],[value],[type],[assign]) VALUES ( 'url_blog_category','./%slug/','string',0 )");
     if ($result = SQL::query("SELECT [key],[value],[type],[assign] FROM [config]p")) {
         foreach ($result->fetch() as $item) {
             switch ($item->type) {
                 case 'string':
                     ESCMS::$cfg[$item->key] = (string) $item->value;
                     break;
                 case 'int':
                 case 'integer':
                     ESCMS::$cfg[$item->key] = (int) $item->value;
                     break;
                 case 'boolean':
                     ESCMS::$cfg[$item->key] = (bool) $item->value;
                     break;
                 default:
                     ESCMS::$cfg[$item->key] = $item->value;
                     break;
             }
             if ((bool) $item->assign) {
                 TPL::add($item->key, $item->value);
             }
             define('CFG_' . strtoupper($item->key), $item->value);
         }
     } else {
         throw new Exception('The configuration could not be loaded.');
     }
 }
开发者ID:jankuca,项目名称:escms,代码行数:29,代码来源:core.layer.php


示例13: index_action

 /**
  *
  */
 public function index_action($id = null)
 {
     if ($id) {
         $c = $this->model('app\\contribute')->byId($id);
         /**
          * belong to channel
          */
         $c->channels = $this->model('matter\\channel')->byMatter($id, 'contribute');
         /**
          * 参与人
          */
         $c->initiator = $this->model('app\\contribute')->userAcls($this->mpid, $id, 'I');
         $c->reviewer = $this->model('app\\contribute')->userAcls($this->mpid, $id, 'R');
         $c->typesetter = $this->model('app\\contribute')->userAcls($this->mpid, $id, 'T');
         /**
          * return
          */
         $channels = \TMS_APP::model('matter\\channel')->byMpid($this->mpid);
         $params = array('mpid' => $this->mpid, 'app' => $c, 'channels' => $channels);
         \TPL::assign('params', $params);
         $this->view_action('/mp/app/contribute/edit');
     } else {
         $this->view_action('/mp/app/contribute');
     }
 }
开发者ID:ahmatjan,项目名称:xinxintong,代码行数:28,代码来源:contribute.php


示例14: run_action

 public function run_action()
 {
     header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
     // Date in the past
     header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
     // always modified
     header('Cache-Control: no-cache, must-revalidate');
     // HTTP/1.1
     header('Pragma: no-cache');
     // HTTP/1.0
     @set_time_limit(0);
     if ($call_actions = $this->model('crond')->start()) {
         foreach ($call_actions as $call_action) {
             if ($plugins = AWS_APP::plugins()->parse('crond', 'main', $call_action)) {
                 foreach ($plugins as $plugin_file) {
                     include $plugin_file;
                 }
             }
             $call_function = $call_action;
             $this->model('crond')->{$call_function}();
         }
     }
     if (AWS_APP::config()->get('system')->debug) {
         TPL::output('global/debuger.tpl.htm');
     }
 }
开发者ID:wenyinos,项目名称:wecenter,代码行数:26,代码来源:main.php


示例15: list_action

 public function list_action()
 {
     if ($_GET['feature_id']) {
         $topic_ids = $this->model('feature')->get_topics_by_feature_id($_GET['feature_id']);
     } else {
         $topic_ids = explode(',', $_GET['topic_id']);
     }
     if ($_GET['per_page']) {
         $per_page = intval($_GET['per_page']);
     } else {
         $per_page = get_setting('contents_per_page');
     }
     if ($_GET['sort_type'] == 'hot') {
         $posts_list = $this->model('posts')->get_hot_posts($_GET['post_type'], $_GET['category'], $topic_ids, $_GET['day'], $_GET['page'], $per_page);
     } else {
         $posts_list = $this->model('posts')->get_posts_list($_GET['post_type'], $_GET['page'], $per_page, $_GET['sort_type'], $topic_ids, $_GET['category'], $_GET['answer_count'], $_GET['day'], $_GET['is_recommend']);
     }
     if (!is_mobile() and $posts_list) {
         foreach ($posts_list as $key => $val) {
             if ($val['answer_count']) {
                 $posts_list[$key]['answer_users'] = $this->model('question')->get_answer_users_by_question_id($val['question_id'], 2, $val['published_uid']);
             }
         }
     }
     TPL::assign('posts_list', $posts_list);
     if (is_mobile()) {
         TPL::output('m/ajax/explore_list');
     } else {
         TPL::output('explore/ajax/list');
     }
 }
开发者ID:Gradven,项目名称:what3.1.7,代码行数:31,代码来源:ajax.php


示例16: index_action

 /**
  *
  */
 public function index_action()
 {
     $mpa = $this->getMpaccount();
     if ($mpa->asparent === 'Y') {
         $params = array();
         $params['mpaccount'] = $mpa;
         \TPL::assign('params', $params);
         $this->view_action('/mp/user/send/parentmp');
     } else {
         /**
          * 是否开通了支持发送消息的接口
          */
         $mpaccount = $this->getMpaccount();
         $apis = $this->model('mp\\mpaccount')->getApis($mpaccount->mpid);
         $canWxGroup = $mpaccount->mpsrc === 'wx' && ($apis->wx_group_push === 'Y' && $apis->wx_fansgroup === 'Y');
         $canYxGroup = $mpaccount->mpsrc === 'yx' && ($apis->yx_group_push === 'Y' && $apis->yx_fansgroup === 'Y');
         $canMember = $apis->mpsrc === 'qy' || $apis->mpsrc === 'yx' && $apis->yx_p2p === 'Y';
         $canSend = $canWxGroup || $canYxGroup || $canMember;
         if ($canSend) {
             $this->view_action('/mp/user/send/main');
         } else {
             $this->view_action('/mp/user/send/unsupport');
         }
     }
 }
开发者ID:ahmatjan,项目名称:xinxintong,代码行数:28,代码来源:send.php


示例17: index_action

 public function index_action()
 {
     if ($_POST['mobile_app_secret']) {
         $this->model('myapi')->save_mobile_app_secret(trim($_POST['mobile_app_secret']));
         H::ajax_json_output(AWS_APP::RSM(null, '-1', AWS_APP::lang()->_t('保存设置成功')));
     }
     TPL::output('admin/mobile_app_config');
 }
开发者ID:androiddream,项目名称:WeCenterMobile-Api,代码行数:8,代码来源:mobile_app_config.php


示例18: index_action

 /**
  *
  */
 public function index_action($aid, $page)
 {
     $options = array('cascaded' => 'N');
     $app = $this->model('app\\enroll')->byId($aid, $options);
     \TPL::assign('title', $app->title);
     \TPL::output('/op/enroll/page');
     exit;
 }
开发者ID:ahmatjan,项目名称:xinxintong,代码行数:11,代码来源:main.php


示例19: rule_action

 public function rule_action()
 {
     $this->crumb(AWS_APP::lang()->_t('%s 积分规则', get_setting('site_name')));
     if (get_setting('integral_system_enabled') != 'Y') {
         H::redirect_msg(AWS_APP::lang()->_t('本站未启用积分系统'), '/');
     }
     TPL::output('integral/rule');
 }
开发者ID:Vizards,项目名称:HeavenSpree,代码行数:8,代码来源:main.php


示例20: redirect_msg

 public static function redirect_msg($message, $url = NULL, $interval = 5)
 {
     TPL::assign('message', $message);
     TPL::assign('url_bit', HTTP::parse_redirect_url($url));
     TPL::assign('interval', $interval);
     TPL::output('global/show_message');
     die;
 }
开发者ID:xuechenli,项目名称:NUAA-Question-Answering,代码行数:8,代码来源:cls_helper.inc.php



注:本文中的TPL类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP TPage类代码示例发布时间:2022-05-23
下一篇:
PHP TLSmarty类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap