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


PHP RainTPL类代码示例

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


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

示例1: action_default

 public function action_default()
 {
     if (isset($_SESSION['user'])) {
         unset($_SESSION['user']);
         session_destroy();
     }
     $tmp2 = new RainTPL();
     return $tmp2->draw('logout', true);
 }
开发者ID:cherry-wb,项目名称:Qemu,代码行数:9,代码来源:logout.php

示例2: index

 public static function index()
 {
     //Get Products Information
     $data = ProductDataSource::getProductData();
     //Initalize Rain TPL templating
     $view = new RainTPL();
     //Assign data to info variable
     $view->assign('info', $data);
     //Draw out HTML
     $view->draw('index');
 }
开发者ID:alikingravi,项目名称:itc,代码行数:11,代码来源:IndexController.php

示例3: getData

 public function getData($url_path = '/teams', $extra = NULL, $template_file = NULL, $useCache = true)
 {
     $wn_current = ltrim(date('W'), '0');
     $wn_previous = ltrim(date('W', strtotime('-7 days')), '0');
     $wn_next = ltrim(date('W', strtotime('+7 days')), '0');
     $extra = str_replace(array('weeknummer=C', 'weeknummer=P', 'weeknummer=N'), array('weeknummer=' . $wn_current, 'weeknummer=' . $wn_previous, 'weeknummer=' . $wn_next), $extra);
     $pluginFolder = dirname(__FILE__);
     if (!isset($template_file) || $template_file == 'template') {
         $template_file = basename($url_path);
         if (strpos($extra, 'slider=1') > -1) {
             // logica voor de slider: 'slider=1'
             $template_file = $template_file . '_slider';
         }
     }
     RainTPL::configure('base_url', NULL);
     RainTPL::configure('tpl_dir', $pluginFolder . '/templates/');
     RainTPL::configure('cache_dir', $pluginFolder . '/cache/');
     RainTPL::configure('path_replace', false);
     $tpl = new RainTPL();
     // standaard 15 minuten cache
     $cache_key = sanitize_file_name($url_path . '_' . $extra);
     if ($useCache && ($cache = $tpl->cache($template_file, $expire_time = 900, $cache_id = $cache_key))) {
         return $cache;
     } else {
         $list = $this->doRequest($url_path, $extra);
         $tpl->assign('logo', strpos($extra, 'logo=1') > -1);
         $tpl->assign('thuisonly', strpos($extra, 'thuisonly=1') > -1);
         $tpl->assign('uitonly', strpos($extra, 'uitonly=1') > -1);
         if (isset($list) && strpos($extra, 'thuis=1') > -1) {
             // logica voor thuisclub eerst in overzichten als 'thuis=1' in $extra zit
             if (strpos($extra, 'uitonly=1') === false) {
                 $thuis = array_filter($list, function ($row) {
                     $length = strlen($this->clubName);
                     return isset($row->ThuisClub) && substr($row->ThuisClub, 0, $length) === $this->clubName;
                 });
                 if (count($thuis) > 0) {
                     $tpl->assign('thuis', $thuis);
                 }
             }
             if (strpos($extra, 'thuisonly=1') === false) {
                 $uit = array_filter($list, function ($row) {
                     $length = strlen($this->clubName);
                     return isset($row->ThuisClub) && substr($row->UitClub, 0, $length) === $this->clubName;
                 });
                 if (count($uit) > 0) {
                     $tpl->assign('uit', $uit);
                 }
             }
         } else {
             $tpl->assign('data', $list);
         }
         return $tpl->draw($template_file, $return_string = true);
     }
 }
开发者ID:wsddsoest,项目名称:knvb-api,代码行数:54,代码来源:knvb-client.php

示例4: action_default

 public function action_default()
 {
     if (isset($_SESSION['user']) == false) {
         return '<div class="error notice">Sie haben keinen Zugriff</div>';
     }
     $query = $GLOBALS['pdo']->prepare("SELECT * FROM users WHERE userID=:user");
     $query->bindValue('user', $_SESSION['user']->id);
     $query->execute();
     $data = $query->fetch();
     $tmp = new RainTPL();
     $tmp->assign('username', $data['username']);
     $tmp->assign('email', $data['email']);
     $tmp->assign('name', $data['name']);
     return $tmp->draw('profil', true);
 }
开发者ID:cherry-wb,项目名称:Qemu,代码行数:15,代码来源:profil.php

示例5: configure

 /**
  * Configuramos RainTPL.
  */
 private static function configure()
 {
     // Defino constantes para URL's relativas.
     if (!defined('THEME_URL')) {
         define('THEME_URL', SITE_URL . 'theme/' . THEME);
     }
     // No usarmos las URL's de RainTPL.
     RainTPL::configure('base_url', '');
     RainTPL::configure('path_replace', FALSE);
     // Configuramos directorio de los template's. Seteamos base para que nuestra
     // extensión se encarge.
     RainTPL::configure('tpl_dir', APP_BASE . DS);
     // Directorio de cache de raintpl ( se usa subdirectorio por la cache de otros
     // elementos).
     RainTPL::configure('cache_dir', CACHE_PATH . DS . 'raintpl' . DS . THEME . DS);
     // Extension de los templates iguales que los archivos generales. Evitamos su
     // descarga.
     RainTPL::configure('tpl_ext', FILE_EXT);
     // Los templates por razones de seguridad no pueden usar variables globales.
     RainTPL::configure('black_list', array('_SESSION', '_POST', '_GET', '_SERVER', '_ENV', '_REQUEST', '\\$this', 'raintpl::', 'self::', 'eval', 'exec', 'unlink', 'rmdir'));
     RainTPL::configure('check_template_update', TRUE);
     // Por defecto no permitimos etiquetas PHP.
     // Es por seguridad y para mantener el patrón MVC.
     RainTPL::configure('php_enabled', FALSE);
     RainTPL::configure('debug', FALSE);
 }
开发者ID:4bs4,项目名称:marifa,代码行数:29,代码来源:view.php

示例6: loadView

 public function loadView($fileName, $data = array(), $return_string = false)
 {
     require_once CORE_DIR . '/rain.tpl.class.php';
     raintpl::configure("base_url", null);
     raintpl::configure("tpl_dir", APP_DIR . "/views/");
     raintpl::configure("cache_dir", APP_DIR . "/cache/");
     $tpl = new RainTPL();
     foreach ($data as $key => $val) {
         $tpl->assign($key, $val);
     }
     $tpl->assign("baseURL", baseURL());
     if ($return_string) {
         $html = $tpl->draw($fileName, true);
         return $html;
     } else {
         $tpl->draw($fileName, false);
     }
 }
开发者ID:khanhicetea,项目名称:kMVC,代码行数:18,代码来源:baseController.php

示例7: RainTPL

 /**
  * Constructor
  *
  * @param string $tpl_dir Template directory. It must be set the first time you use the class
  * @return RainTPL
  */
 function RainTPL($tpl_dir = null, $tpl_compile_dir = null, $base_dir = null)
 {
     if ($tpl_dir) {
         RainTPL::$tpl_dir = $tpl_dir . (substr($tpl_dir, -1, 1) != "/" ? "/" : "");
     }
     if ($tpl_compile_dir) {
         RainTPL::$tpl_compile_dir = $tpl_compile_dir;
     }
     if ($base_dir) {
         RainTPL::$base_dir = $base_dir;
     }
 }
开发者ID:irieKEN,项目名称:freepbx-endpointmanager,代码行数:18,代码来源:rain.tpl.class.php

示例8: __construct

 /**
  * Constructor..
  * PDOException throwable
  */
 public function __construct($templateDirectory, $cacheDirectory, $templateExtension = 'html', $templatePrefix = '', $debug = false)
 {
     RainTPL::$tpl_dir = $templateDirectory;
     // template directory
     RainTPL::$cache_dir = $cacheDirectory;
     // cache directory
     RainTPL::$tpl_ext = $templateExtension;
     RainTPL::$path_replace = false;
     $this->rainTPL = new RainTPL();
     $this->dataDispatcher = new DataDispatcher();
     $this->tplDir = $templateDirectory;
     $this->tplExt = $templateExtension;
     $this->tplPrefix = $templatePrefix;
     $this->debug = $debug;
 }
开发者ID:AleCiri,项目名称:grCms,代码行数:19,代码来源:NavigationController.php

示例9: AssignVars

 /**
  * @static
  * @param RainTPL $tpl Das zuzuweisende Template
  * @param $title string Der Titel der Seite
  */
 public static function AssignVars(RainTPL &$tpl, $title = '')
 {
     $tpl->assign('login', $_SESSION['session']->getLogin());
     $tpl->assign('title', $title === '' ? TIPPSPIEL_CONF_TITLE : $title . ' | ' . TIPPSPIEL_CONF_TITLE);
     if ($_SESSION['session']->getErrno() !== 0) {
         $tpl->assign('permlogin_error', true);
         $tpl->assign('permlogin_msg', $_SESSION['session']->getError());
     } else {
         $tpl->assign('permlogin_error', false);
     }
 }
开发者ID:nichdu,项目名称:tippspiel,代码行数:16,代码来源:StartUp.class.php

示例10: action_default

 public function action_default()
 {
     $tmp2 = new RainTPL();
     $query = $GLOBALS['pdo']->prepare("SELECT * FROM vm WHERE owner = :owner");
     $query->bindValue(":owner", $_SESSION['user']->id, PDO::PARAM_INT);
     $query->execute();
     if ($query->rowCount() > 0) {
         $vms = array();
         while ($ds = $query->fetch()) {
             if ($ds['lastrun'] != '0000-00-00') {
                 $lastrun = date("d.m.Y H:i", strtotime($ds['lastrun']));
             } else {
                 $lastrun = '---';
             }
             if ($ds['status'] == QemuMonitor::RUNNING) {
                 $buttons = '<a href="index.php?site=myvm&action=stop&vmID=' . $ds['vmID'] . '" class="button red small center"><span class="icon" data-icon="Q"></span>Stop</a>';
                 $buttons .= '<a href="screenshot.php?vmID=' . $ds['vmID'] . '" class="button small center"><span class="icon" data-icon="0"></span>Screenshot</a>';
                 if ($ds['password']) {
                     $buttons .= '<a href="vnc.php?vmID=' . $ds['vmID'] . '" class="button small center grey"><span class="icon" data-icon="0"></span>VNC</a>';
                     $buttons .= '<a href="index.php?site=vnc&vmID=' . $ds['vmID'] . '" class="button small center grey"><span class="icon" data-icon="0"></span>Web-VNC</a>';
                 } else {
                     $buttons .= '<a href="#' . $ds['vmID'] . '" disabled="disabled" class="button small center grey vm_disabled"><span class="icon" data-icon="0"></span>VNC</a>';
                 }
             } else {
                 $buttons = '<a href="index.php?site=myvm&action=start&vmID=' . $ds['vmID'] . '" class="button green small center"><span class="icon" data-icon="&nbsp;"></span>Start</a>';
                 $buttons .= '<a class="button small center grey"><span class="icon" data-icon="G"></span>Edit</a>';
             }
             $vm = array();
             $vm['lastrun'] = $lastrun;
             $vm['buttons'] = $buttons;
             $vm['name'] = $ds['name'];
             $vm['ram'] = FileSystem::formatFileSize($ds['ram'] * 1024 * 1024, 0);
             $vms[] = $vm;
         }
         $tmp2->assign('vms', $vms);
         return $tmp2->draw('myvm_table', true);
     } else {
         return "Du hast noch keine VM. Du musst warten bis dir eine zugeteilt wird von den Admins.";
     }
 }
开发者ID:cherry-wb,项目名称:Qemu,代码行数:40,代码来源:myvm.php

示例11: init

 public function init()
 {
     if ($this->engine === 'smarty') {
         require_once "resources/templates/engine/smarty/Smarty.class.php";
         $this->object = new Smarty();
         $this->object->setTemplateDir($this->template_dir);
         $this->object->setCompileDir($this->cache_dir);
         $this->object->setCacheDir($this->cache_dir);
     }
     if ($this->engine === 'raintpl') {
         require_once "resources/templates/engine/raintpl/rain.tpl.class.php";
         $this->object = new RainTPL();
         RainTPL::configure('tpl_dir', realpath($this->template_dir) . "/");
         RainTPL::configure('cache_dir', realpath($this->cache_dir) . "/");
     }
     if ($this->engine === 'twig') {
         require_once "resources/templates/engine/Twig/Autoloader.php";
         Twig_Autoloader::register();
         $loader = new Twig_Loader_Filesystem($this->template_dir);
         $this->object = new Twig_Environment($loader);
         $lexer = new Twig_Lexer($this->object, array('tag_comment' => array('{*', '*}'), 'tag_block' => array('{', '}'), 'tag_variable' => array('{$', '}')));
         $this->object->setLexer($lexer);
     }
 }
开发者ID:bitplus,项目名称:fusionpbx,代码行数:24,代码来源:template.php

示例12: serialize

    if (AUTO_LOGIN != '') {
        $myUser = $userManager->exist(AUTO_LOGIN, '', true);
        $_SESSION['currentUser'] = serialize($myUser);
    }
}
if (!$myUser && isset($_COOKIE[$conf->get('COOKIE_NAME')])) {
    $users = User::getAllUsers();
    foreach ($users as $user) {
        if ($user->getCookie() == $_COOKIE[$conf->get('COOKIE_NAME')]) {
            $myUser = $user;
            $myUser->loadRight();
        }
    }
}
//Instanciation du template
$tpl = new RainTPL();
//Definition des dossiers de template
raintpl::configure("base_url", null);
raintpl::configure("tpl_dir", './templates/' . $conf->get('DEFAULT_THEME') . '/');
raintpl::configure("cache_dir", "./cache/tmp/");
$view = '';
$rank = new Rank();
if ($myUser != false && $myUser->getRank() != false) {
    $rank = $rank->getById($myUser->getRank());
}
$tpl->assign('myUser', $myUser);
$tpl->assign('userManager', $userManager);
$tpl->assign('configurationManager', $conf);
$tpl->assign('error', $error);
$tpl->assign('notice', $message);
$tpl->assign('_', $_);
开发者ID:parrain27,项目名称:yana-server,代码行数:31,代码来源:common.php

示例13: define

 * 
 * @ Kaveh Raji <kr@vitabytes.de>
 */
define("ROOTPATH", $_SERVER["DOCUMENT_ROOT"] . "/");
define("PROJECTPATH", ROOTPATH . "Your-Project-Path/");
/* 
 * First including the configuration - file which can contain neccessary - data
 */
include PROJECTPATH . "inc/conf.inc.php";
//include the RainTPL class
include PROJECTPATH . "inc/rain.tpl.class.php";
raintpl::configure("base_url", null);
raintpl::configure("tpl_dir", "tpl/");
raintpl::configure("cache_dir", "tmp/");
raintpl::configure('path_replace', false);
$tpl = new RainTPL();
/* 
 * Now including some libaries needed
 */
include PROJECTPATH . "inc/libs/vitabytes/sleekshop_request.inc.php";
include PROJECTPATH . "inc/libs/vitabytes/mailing.inc.php";
/* 
 * Including models and controllers
 */
include PROJECTPATH . "inc/categories.inc.php";
include PROJECTPATH . "inc/shopobjects.inc.php";
include PROJECTPATH . "inc/session.inc.php";
include PROJECTPATH . "inc/cart.inc.php";
include PROJECTPATH . "inc/user.inc.php";
include PROJECTPATH . "inc/order.inc.php";
include PROJECTPATH . "inc/payment.inc.php";
开发者ID:sleekshop,项目名称:demoshop,代码行数:31,代码来源:init.inc.php

示例14: define

<?php

define('IN_GB', TRUE);
include "includes/gb.class.php";
include "includes/config.php";
include "language/{$default_language}";
include "includes/rain.tpl.class.php";
include "includes/sanitize.php";
raintpl::configure("base_url", null);
raintpl::configure("tpl_dir", "themes/{$theme}/");
raintpl::configure("cache_dir", "cache/");
//initialize a Rain TPL object
$tpl = new RainTPL();
$tpl->assign("theme", $theme);
$tpl->assign("title", $title);
$tpl->assign("headingtitletxt", $headingtitletxt);
$tpl->assign("addentrytxt", $addentrytxt);
$tpl->assign("viewguestbooktxt", $viewguestbooktxt);
$tpl->assign("newpostfirsttxt", $newpostfirsttxt);
$tpl->assign("newpostlasttxt", $newpostlasttxt);
$tpl->assign("searchlabeltxt", $searchlabeltxt);
$tpl->assign("searchbuttontxt", $searchbuttontxt);
$tpl->assign("currentyear", date("Y"));
$tpl->assign("goback", $goback);
$search = sanitize_html_string($_POST['search_term']);
$pageNum = sanitize_int($_GET['page'], 0, 9000);
// Set Search Variables
if ($search == "") {
    $search = sanitize_html_string($_GET['search_term']);
}
if ($pageNum == "") {
开发者ID:valarmoghulis,项目名称:php,代码行数:31,代码来源:search.php

示例15: db_query

    $image = 'sup_image';
}
$db_bill_debit = new db_query('SELECT * FROM ' . $tabel . ' ' . $left_join . '
                                WHERE ' . $id_column . ' 
                                AND ' . $status . ' = 0');
$number_bill = mysqli_num_rows($db_bill_debit->result);
while ($data_bill_debit = mysqli_fetch_assoc($db_bill_debit->result)) {
    $name = $data_bill_debit[$name_key];
    $total_debit += $data_bill_debit[$totalmoney];
    if ($data_bill_debit[$image] == '') {
        $avatar = $avatars;
    } else {
        $avatar = '<img src="' . get_picture_path($data_bill_debit[$image]) . '"/>';
    }
}
$total_money = '<span class="total_money" data-total_money="' . $total_debit . '">' . number_format($total_debit) . '</span>';
$rainTpl = new RainTPL();
add_more_css('pay_debit.css', $load_header);
$rainTpl->assign('load_header', $load_header);
$rainTpl->assign('name_object', $name_object);
$rainTpl->assign('name', $name);
$rainTpl->assign('id', $id);
$rainTpl->assign('record_id', $record_id);
$rainTpl->assign('type', $type);
$rainTpl->assign('avatar', $avatar);
$rainTpl->assign('number_bill', $number_bill);
$rainTpl->assign('total_debit', $total_debit);
$rainTpl->assign('total_money', $total_money);
$rainTpl->assign('footer_control', $footer_control);
$rainTpl->assign('link_custom_script', '<script type="text/javascript" src="script_debit.js"></script>');
$rainTpl->draw('content_pay_debit');
开发者ID:virutmath,项目名称:crm_local,代码行数:31,代码来源:pay_debit.php


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