本文整理匯總了PHP中TPL::output方法的典型用法代碼示例。如果您正苦於以下問題:PHP TPL::output方法的具體用法?PHP TPL::output怎麽用?PHP TPL::output使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TPL
的用法示例。
在下文中一共展示了TPL::output方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: 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');
}
示例2: 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');
}
示例3: 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');
}
示例4: 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');
}
示例5: 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');
}
}
示例6: 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');
}
}
示例7: parse_attachs_callback
/**
* 僅附件處理中的preg_replace_callback()的每次搜索時的回調
* @param array $matches preg_replace_callback()搜索時返回給第二參數的結果
* @return string 取出附件的加載模板字符串
*/
function parse_attachs_callback($matches)
{
if ($attach = AWS_APP::model('publish')->get_attach_by_id($matches[1])) {
TPL::assign('attach', $attach);
return TPL::output('question/ajax/load_attach', false);
}
}
示例8: 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');
}
}
示例9: index_action
/**
* 走馬燈抽獎頁麵
*/
public function index_action($aid)
{
$app = $this->model('app\\enroll')->byId($aid);
\TPL::assign('enroll', $app);
\TPL::output('/op/enroll/lottery');
exit;
}
示例10: 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;
}
示例11: 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;
}
示例12: index_action
public function index_action()
{
if (!$this->user_info['email']) {
H::redirect_msg(AWS_APP::lang()->_t('當前帳號沒有提供 Email, 此功能不可用'));
}
$this->crumb(AWS_APP::lang()->_t('邀請好友'), '/invitation/');
TPL::output('invitation/index');
}
示例13: 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');
}
示例14: 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');
}
示例15: 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;
}