当前位置: 首页>>代码示例>>PHP>>正文


PHP Template::serve方法代码示例

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


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

示例1: userlist

 function userlist()
 {
     if (!F3::get('SESSION.asid')) {
         F3:
         reroute('/admin');
     }
     $user = new Axon('tbl_user');
     $users = array();
     $user_list = $user->find();
     if ($user_list != NULL) {
         foreach ($user_list as $ul) {
             $users[] = array($ul->email, $ul->username, '<img src="' . $ul->image . '" width="20px" height="20px" /> ' . $ul->fullname, $ul->active == 'y' ? 'Yes' : 'No', '<center><a href="#" class="blockLink" data-id="' . $ul->id . '">' . ($ul->active == 'y' ? 'Block' : 'Unblock') . '</a><br/><a href="#" class="deleteLink" data-id="' . $ul->id . '">Delete</a></center>');
         }
         $i = 0;
         foreach ($user_list as $user) {
             $user_id[] = $user_list[$i]->id;
             $i++;
         }
     } else {
         $users = 0;
         $user_id = 0;
     }
     $this->set('identity', $user_id);
     $this->set('userList', $users);
     $this->set('title', 'User');
     if (Snippets::_isAjax()) {
         echo Template::serve("template/admin/user.htm");
     } else {
         $this->set('template', 'user');
         echo Template::serve("template/admin/layout.htm");
     }
 }
开发者ID:pshreez,项目名称:PHP,代码行数:32,代码来源:user.php

示例2: createAndServe

 public function createAndServe($id, $msg = '')
 {
     $db = new Database();
     $data = $db->getData($id);
     $template = new Template($id, $data);
     $template->serve();
     $logs = new Logger();
     //        $logs->log("Create a page for ID {$id}");
     $logs->log($msg);
 }
开发者ID:RCVDangTung,项目名称:syntax,代码行数:10,代码来源:facade.php

示例3: user_home

 function user_home()
 {
     $id = F3::get("PARAMS.sid");
     if (F3::get("SESSION.onlineUser")) {
         F3::set('navUser', 'userNav');
         $this->list_saved_form();
         F3::set('template', 'home');
         echo Template::serve("template/layout.html");
     } else {
         F3::reroute('/');
     }
 }
开发者ID:pshreez,项目名称:PHP,代码行数:12,代码来源:user_login.php

示例4: all

 function all()
 {
     $poll = new Axon('tbl_poll');
     //  echo 123;die;
     // $this->set('title', 'Quizzes');
     $poll->def('fullname', 'SELECT fullname FROM tbl_user WHERE tbl_poll.user_id=tbl_user.id');
     $poll->def('image', 'SELECT image FROM tbl_user WHERE tbl_poll.user_id=tbl_user.id');
     $poll->def('hits', 'SELECT COUNT(date) FROM tbl_vote WHERE tbl_poll.id=tbl_vote.poll_id');
     $q = $poll->find('published_date IS NOT NULL AND is_archive="n" AND expiry_date>now() AND private="n"');
     $polls = array();
     foreach ($q as $qu) {
         $polls[$qu->id] = array(strtoupper($qu->keyword), $qu->question, '<img src="' . $qu->image . '" width="20px" height="20px" /> ' . $qu->fullname);
     }
     $this->set('title', 'All polls');
     $this->set('pollList', $polls);
     $this->set('template', 'all');
     echo Template::serve("template/layout.htm");
 }
开发者ID:pshreez,项目名称:PHP,代码行数:18,代码来源:infoPoll.php

示例5: _showError

 public static function _showError($message = "")
 {
     if (Snippets::_isAjax()) {
         if (Snippets::_isPost()) {
             $ret = array('error' => true);
             if ($message == "") {
                 $message = F3::get('ERROR.text');
             }
             $ret['message'] = $message;
             echo json_encode($ret);
         } else {
             $ret = 'error';
             if ($message == "") {
                 $message = F3::get('ERROR.text');
             }
             $ret .= " [{$message}]";
             echo $ret;
         }
     } else {
         F3::set('title', 'Page Not Found');
         F3::set('template', 'error');
         echo Template::serve("template/layout.htm");
     }
 }
开发者ID:pshreez,项目名称:PHP,代码行数:24,代码来源:snippets.php

示例6: Exception

            //###Check if file uploaded successfully
            if ($uploadResult->status == "Ok") {
                $fileGuId = $uploadResult->result->guid;
            } else {
                throw new Exception($uploadResult->error_message);
            }
        }
        //Make request yo the Api to get images for all document pages
        $pageImage = $api->GetDocumentPagesImageUrls($clientId, $fileGuId, 0, null, '650x500', null, null, null);
        $url = "";
        $image = "";
        //Check the result of the request
        if ($pageImage->status == "Ok") {
            //### If request was successfull
            for ($i = 0; $i < count($pageImage->result->url); $i++) {
                $image .= '<img src="' . $pageImage->result->url[$i] . '"></img><br/>';
            }
        } else {
            throw new Exception($pageImage->error_message);
        }
        //Set variable with results for template
        F3::set("fileId", $fileGuId);
        F3::set('image', $image);
    }
} catch (Exception $e) {
    $error = 'ERROR: ' . $e->getMessage() . "\n";
    F3::set('error', $error);
}
//Process template
echo Template::serve('sample23.htm');
开发者ID:groupdocs,项目名称:groupdocs-php,代码行数:30,代码来源:sample23.php

示例7: getSavedNamsari

 function getSavedNamsari()
 {
     if (!F3::get('SESSION.onlineUser')) {
         F3::reroute("/");
     }
     $id = new Form_elements();
     $date = DATE('Y-m-d');
     $id = new Form_elements();
     $owner_type = $id->owner_type();
     $zone_code = $id->zone_code();
     $district_code = $id->district_code();
     $date = DATE('Y-m-d');
     $zone_code = $id->zone_code();
     $type_symbol = $id->type_symbol();
     $vehicle = F3::get("PARAMS.trans");
     $data = new Axon("vehicle");
     $owner = new Axon("owner");
     $namsari = new Axon("namsari");
     if ($data->found(array('id=:id', array(':id' => $vehicle))) && $owner->found(array('vehicleid =:id', array(':id' => $vehicle))) && $namsari->found(array('vehicle_id=:id', array(':id' => $vehicle)))) {
         $data->load(array('id=:id', array(':id' => $vehicle)));
         $owner->load(array('vehicleid =:id', array(':id' => $vehicle)));
         $namsari->load(array('vehicle_id =:id', array(':id' => $vehicle)));
         $owner_photo = new Axon("owner_photo");
         if ($owner_photo->found(array('vehicle_id=:pic', array(':pic' => $vehicle)))) {
             $owner_photo->load(array('vehicle_id=:pic', array(':pic' => $vehicle)));
             $owner_photo->copyTo("POST");
         }
         //   var_dump($data->find("id='$vehicle'"));die;
         $data->copyTo("POST");
         $owner->copyTo("POST");
         $namsari->copyTo("POST");
         F3::set('heading', 'नया सवारी धनी विवरण ');
         F3::set('date', $date);
         F3::set('navUser', 'userNav');
         F3::set('title', 'Admin - approve Namsari');
         F3::set('template', 'transfer');
         echo Template::serve("template/layout.html");
     }
 }
开发者ID:pshreez,项目名称:PHP,代码行数:39,代码来源:SavedForm.php

示例8: function

    F3::set('config_permissions', $settings->config_permissions);
    $status_buttons = Template::serve('ui/status_buttons.html');
    F3::set('status_buttons', Template::serve('ui/status_buttons.html'));
    F3::set('content', Template::serve('ui/settings.html'));
    echo Template::serve('ui/template.html');
}
*/
F3::route('GET /settings', function () {
    global $settings;
    $settings->settings_page_data();
    F3::set('company_logos', $settings->company_logos);
    //        F3::set('debug', $settings->debug);
    F3::set('config_permissions', $settings->config_permissions);
    $status_buttons = Template::serve('ui/status_buttons.html');
    F3::set('status_buttons', Template::serve('ui/status_buttons.html'));
    F3::set('content', Template::serve('ui/settings.html'));
    echo Template::serve('ui/template.html');
});
F3::route('GET /set_permissions', function () {
    global $settings;
    $settings->set_permissions();
    F3::reroute('/settings');
});
F3::route('POST /save_settings', function () {
    $post_data = $_POST;
    $settings = new Settings();
    $settings->save();
    F3::reroute('/settings');
});
F3::route('GET /debug', 'debug.php');
F3::run();
开发者ID:retorick,项目名称:scalex-portal,代码行数:31,代码来源:index.php

示例9: getTOU

 function getTOU()
 {
     $this->set('title', 'Terms of Use');
     F3::set('template', 'tou');
     echo Template::serve("template/layout.htm");
 }
开发者ID:pshreez,项目名称:PHP,代码行数:6,代码来源:app.php

示例10: reportLog

 function reportLog()
 {
     if (F3::get('SESSION.asid')) {
         F3::reroute("/admin");
     }
     $admin = new Axon("admin_log");
     // $users=$admin->afind();
     $date1 = F3::get("POST.date1");
     $date2 = F3::get("POST.date2");
     if ($users = $admin->found()) {
         // var_dump($users);die;
         $users = $admin->afind("date between '" . $date1 . "' and '" . $date2 . "'");
         F3::set('report', $users);
         F3::set('nav', 'navigation');
         F3::set('title', 'Admin - Log');
         F3::set('templateAdmin', 'adminLog');
         echo Template::serve("template/layout.html");
     } else {
         $users = array();
         F3::set('report', $users);
         F3::set('nav', 'navigation');
         F3::set('templateAdmin', 'adminLog');
         echo Template::serve("template/layout.html");
     }
 }
开发者ID:pshreez,项目名称:PHP,代码行数:25,代码来源:admin.php

示例11: elseif

            if ($createAnnotation->result) {
                //Generation of iframe URL using fileGuId
                if ($basePath == "https://api.groupdocs.com/v2.0") {
                    $iframe = 'http://apps.groupdocs.com/document-annotation2/embed/' . $createAnnotation->result->documentGuid . '?frameborder="0" width="720" height="600"';
                    //iframe to dev server
                } elseif ($basePath == "https://dev-api.groupdocs.com/v2.0") {
                    $iframe = 'http://dev-apps.groupdocs.com/document-annotation2/embed/' . $createAnnotation->result->documentGuid . '?frameborder="0" width="720" height="600"';
                    //iframe to test server
                } elseif ($basePath == "https://stage-api-groupdocs.dynabic.com/v2.0") {
                    $iframe = 'https://stage-apps-groupdocs.dynabic.com/document-annotation2/Embed/' . $createAnnotation->result->documentGuid . '?frameborder="0" width="720" height="600"';
                    //Iframe to realtime server
                } elseif ($basePath == "http://realtime-api.groupdocs.com") {
                    $iframe = 'http://realtime-apps.groupdocs.com/document-annotation2/embed/' . $createAnnotation->result->documentGuid . '?frameborder="0" width="720" height="600"';
                }
                $iframe = $signer->signUrl($iframe);
                F3::set('annotationId', $createAnnotation->result->annotationGuid);
                F3::set('annotationType', $annotationType);
                F3::set('annotationText', $replyText);
                F3::set('url', $iframe);
            }
        } else {
            throw new Exception($createAnnotation->error_message);
        }
    } catch (Exception $e) {
        $error = 'ERROR: ' . $e->getMessage() . "\n";
        F3::set('error', $error);
    }
}
// Process template
echo Template::serve('sample11.htm');
开发者ID:groupdocs,项目名称:groupdocs-php,代码行数:30,代码来源:sample11.php

示例12: register_print

 function register_print()
 {
     $id = F3::get("PARAMS.id");
     $vehicle = F3::get("PARAMS.id");
     $data = new Axon("vehicle");
     $owner = new Axon("owner");
     if ($data->found(array('id=:id', array(':id' => $id))) && $owner->found(array('vehicleid =:id', array(':id' => $id)))) {
         // echo 123;
         $data->load(array('id=:id', array(':id' => $vehicle)));
         $owner->load(array('vehicleid =:id', array(':id' => $vehicle)));
         //  $namsari->load(array('vehicle_id =:id', array(':id' => $vehicle)));
         $zone_code = $id->zone_view($data->zone_id);
         // F3::set('code', $zone_code);
         $symbol_view = $id->symbol_view($data->vehicle_symbol_type);
         $owner_view = $id->owner_view($owner->owner_type);
         $p_zone_id = $id->zone_view($owner->p_zone_id);
         $temp_zone_id = $id->zone_view($owner->temp_zone_id);
         //  F3::set('zone', $p_zone_id);
         //$p_district_id = $id->district_view($data->p_district_id);
         // $temp_district_id = $id->district_view($data->temp_district_id);
         $nabalik_district = $id->district_view($data->nabalik_district);
         $creditor_district = $id->district_view($data->creditor_district);
         $per_district = $id->district_view($data->per_district);
         $owner->copyTo("POST");
         $data->copyTo("POST");
         $namsari->copyTo("POST");
         F3::set('date', $date);
         //  F3::set('nav', 'navigation');
         echo Template::serve("template/admin/registration_print.htm");
     }
 }
开发者ID:pshreez,项目名称:PHP,代码行数:31,代码来源:printDoc.php

示例13: transfer_ownership

 function transfer_ownership()
 {
     if (!F3::get('SESSION.onlineUser')) {
         F3::reroute("/");
     }
     $id = new Form_elements();
     $owner_type = $id->owner_type();
     $zone_code = $id->zone_code();
     $district_code = $id->district_code();
     $date = DATE('Y-m-d');
     F3::set('date', $date);
     //   F3::set('heading', 'नया  सवारी धनी विवरण ');
     $zone_code = $id->zone_code();
     $type_symbol = $id->type_symbol();
     F3::set('date', $date);
     F3::set('title', 'सवारी नामसारी  ');
     F3::set('navUser', 'userNav');
     F3::set('template', 'transfer');
     echo Template::serve("template/layout.html");
 }
开发者ID:pshreez,项目名称:PHP,代码行数:20,代码来源:user.php

示例14: DB

<?php

//echo 123;die;
$main = (require __DIR__ . './lib/base.php');
$main->set('DEBUG', 3);
$main->set('UI', 'ui/');
$main->set('AUTOLOAD', 'app/');
$main->set('DB', new DB('mysql:host=localhost;dbname=polls', 'root', ''));
// Site title
$main->set('site', 'SMSCentral Poll Application');
$main->set('conf', array('PAGESIZE' => 20, 'imes' => 'Invalid poll', 'tmes' => 'Thank you for your vote', 'mes' => " '<br>'Create your own poll. Log on to: www.smscentral.com.np/poll", 'smes' => 'Check out this poll'));
$main->set('ONERROR', function () {
    F3::set('template', 'error');
    echo Template::serve("template/layout.htm");
});
//before session
$main->route('GET /home', 'App->getHome;');
$main->route('GET /poll/@pid', 'App->view;');
$main->route('GET /pollView/@pid', 'App->pollView');
//user functionality
$main->route('GET /logout', 'User->logout;');
$main->route('GET /login/@sid', 'User->login');
$main->route('POST /login', 'User->login');
//user functionality for polls
$main->route('GET /terms', 'App->getTOU');
$main->route('GET /create', 'App->create');
//shows form
$main->route('GET /myPolls', 'App->mypolls;');
$main->route('GET /polls/@id', 'App->mypolls;');
$main->route('POST /myPolls', 'Poll->add;');
//add and store poll to database
开发者ID:pshreez,项目名称:PHP,代码行数:31,代码来源:index.php

示例15: onError

 public static function onError($message = "")
 {
     F3::set('templateAdmin', 'error');
     echo Template::serve("template/layout.html");
 }
开发者ID:pshreez,项目名称:PHP,代码行数:5,代码来源:error.php


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