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


PHP Template::get方法代码示例

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


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

示例1: testGet

 /**
  * @covers Template::get
  */
 public function testGet()
 {
     $key = "class";
     $value = "errorCall";
     $this->object->set($key, $value);
     $this->assertSame($value, $this->object->get($key));
 }
开发者ID:fruition-sciences,项目名称:phpfw,代码行数:10,代码来源:TemplateTest.php

示例2: output

 public static function output($vars = '')
 {
     // variables
     $template = new Template($vars);
     $cache = null;
     $id = "{$_SERVER['HTTP_HOST']}/html/" . $template->hash;
     // get available cache (if applicable)
     if ($template->canCache()) {
         // first thing, check if there's a cached version of the template
         $cache = self::getCache($id);
     }
     //$cache = false;
     if (!empty($cache) && !DEBUG) {
         echo $cache;
         return;
     }
     // continue processing
     $template->setupClient();
     //
     $GLOBALS['body'] = $template->vars["body"];
     $GLOBALS['head'] = $template->get("head");
     $GLOBALS['foot'] = $template->get("foot");
     // compile the page with the existing data
     $output = $template->do_fetch($template->file, $template->vars);
     // post-process (in debug with limited features)
     $output = $template->process($output);
     // output the final markup - clear whitespace (if not in debug mode)
     echo $output;
     // set the cache for later use
     self::setCache($id, $output);
 }
开发者ID:makesites,项目名称:kisscms,代码行数:31,代码来源:template.php

示例3: jkbanners_display_banners

function jkbanners_display_banners($atts)
{
    $a = shortcode_atts(array('id' => false, 'filter_menu_order' => false, 'template' => 'list'), $atts);
    $output = array();
    //
    $banners = array();
    $banners = Banner::getAll();
    if ($a['filter_menu_order']) {
        foreach ($banners as $bk => $banner) {
            if ($banner->post->menu_order != $a['filter_menu_order']) {
                unset($banners[$bk]);
            }
        }
    }
    //
    $bannerTemplate = new Template();
    //One random banner
    if ($a['template'] == 'random-single') {
        //get a random item
        $banner = $banners[array_rand($banners)];
        //show single banner
        $bannerTemplateResponse = $bannerTemplate->get(__DIR__ . '/templates/single.php', array('banner' => $banner));
        $output[] = $bannerTemplateResponse;
    }
    //List all banners
    if ($a['template'] == 'list') {
        $bannerTemplateResponse = $bannerTemplate->get(__DIR__ . '/templates/list.php', array('banners' => $banners));
        $output[] = $bannerTemplateResponse;
    }
    //
    $output = implode("\n", $output);
    return $output;
}
开发者ID:kilrizzy,项目名称:WP-JK-Banners,代码行数:33,代码来源:jk-banners.php

示例4: __construct

 public function __construct($esxman, $database, $username = '', $error = null)
 {
     $this->esxman = $esxman;
     $this->database = $database;
     $this->username = $username;
     $this->html = array('footer' => ' ', 'menu' => ' ', 'tree' => ' ', 'user' => ' ', 'content' => ' ');
     $this->commands = array();
     $this->title = _('Login');
     if (request('form_name') == 'login') {
         if ($this->database->authenticate_user(request('username'), request('password'))) {
             session_destroy();
             session_start();
             $_SESSION['username'] = request('username');
             $_SESSION['key'] = md5($_SESSION['username'] . getenv('REMOTE_ADDR') . getenv('X-FORWARDED-FOR'));
             debug('User ' . request('username') . ' logging in!');
             $this->commands[] = "\$('#dialog').html('" . _('Populating inventory...') . "');";
             $this->commands[] = js_command('get', 'action=populate_inventory');
             return;
         }
         $error = _('Authentication failed');
     }
     $tpl = new Template('dialog_login.html');
     if ($error) {
         $tpl->setVar('error', $error);
         $tpl->parse('error_message');
     }
     $this->commands[] = js_command('display_dialog', _('Login'), $tpl->get(), _('Login'));
 }
开发者ID:robinelfrink,项目名称:php-esx-manager,代码行数:28,代码来源:login.php

示例5: index

 /**
  * Displays a list of tables in the database.
  */
 public function index()
 {
     $hide_form = false;
     // Are we performing an action?
     if (isset($_POST['action'])) {
         // Checked the checked() variable
         $_POST['checked'] = isset($_POST['checked']) ? $_POST['checked'] : '';
         switch (strtolower($_POST['action'])) {
             case strtolower(lang('db_backup')):
                 $hide_form = $this->backup($_POST['checked']);
                 break;
             case strtolower(lang('db_repair')):
                 $this->repair($_POST['checked']);
                 break;
             case strtolower(lang('db_optimize')):
                 $this->optimize();
                 break;
             case strtolower(lang('db_drop')):
                 $hide_form = $this->drop($_POST['checked']);
                 break;
         }
     }
     if (!$hide_form) {
         $this->load->helper('number');
         Template::set('tables', $this->db->query('SHOW TABLE STATUS')->result());
     }
     if (!Template::get('toolbar_title')) {
         Template::set('toolbar_title', lang('db_database_maintenance'));
     }
     Template::render();
 }
开发者ID:nazrulworld,项目名称:Bonfire,代码行数:34,代码来源:developer.php

示例6: render

 public function render()
 {
     $asset = Assets::get();
     $this->addData(['css' => $asset->Css(), 'js' => $asset->Js(), 'internalCss' => $asset->InternalCss(), 'jsReady' => $asset->OnLoadJs()]);
     $tpl = Template::get()->loadTemplate($this->template);
     return $tpl->render($this->data);
 }
开发者ID:balucio,项目名称:smac,代码行数:7,代码来源:main.php

示例7: form

 public static function form(\Request $request, $command = null)
 {
     javascript('jquery');
     \Form::requiredScript();
     if (empty($command)) {
         $command = 'run_search';
     }
     $system_locations = \systemsinventory\Factory\SystemDevice::getSystemLocations();
     $location_options = '<option value="0">All</opton>';
     foreach ($system_locations as $val) {
         $location_options .= '<option value="' . $val['id'] . '">' . $val['display_name'] . '</option>';
     }
     $vars['locations'] = $location_options;
     $system_types = \systemsinventory\Factory\SystemDevice::getSystemTypes();
     $type_options = '<option value="0">All</opton>';
     foreach ($system_types as $val) {
         $type_options .= '<option value="' . $val['id'] . '">' . $val['description'] . '</option>';
     }
     $vars['system_types'] = $type_options;
     $system_dep = \systemsinventory\Factory\SystemDevice::getSystemDepartments();
     $dep_optons = '<option value="0">All</opton>';
     foreach ($system_dep as $val) {
         $dep_optons .= '<option value="' . $val['id'] . '">' . $val['display_name'] . '</option>';
     }
     $vars['departments'] = $dep_optons;
     $vars['form_action'] = "./systemsinventory/search/" . $command;
     $template = new \Template($vars);
     $template->setModuleTemplate('systemsinventory', 'Search_System.html');
     return $template->get();
 }
开发者ID:AppStateESS,项目名称:systemsinventory,代码行数:30,代码来源:Search.php

示例8: respuestaConsulta

 public function respuestaConsulta($array)
 {
     $obj = (object) $array;
     $usuario = Usuario::getById($obj->user_id);
     $template = new Template('consulta-response', array('asunto' => $obj->asunto, 'nombre' => $obj->nombre, 'apellido' => $obj->apellido, 'mensaje' => $obj->mensaje, 'fecha' => date('d/m/Y')));
     $this->Body = $template->get();
     $this->send();
 }
开发者ID:EzequielDot175,项目名称:core_nufarm,代码行数:8,代码来源:class.mail.php

示例9: track

 /**
  * Validate an Address to UPS AddressValidation API
  *
  * @access public
  * @param string $tracking_number
  * @return array $response
  */
 public function track($tracking_number)
 {
     $template = Template::get();
     $template->assign('tracking_number', $tracking_number);
     $xml = $template->render('call/track.twig');
     $result = $this->call('Track', $xml);
     return $result;
 }
开发者ID:tigron,项目名称:shipping-ups,代码行数:15,代码来源:Track.php

示例10: index

 /** 
  * function index
  *
  * list form data
  */
 function index()
 {
     Template::set('records', $this->permission_model->find_all());
     if (!Template::get("toolbar_title")) {
         Template::set("toolbar_title", lang("permissions_manage"));
     }
     Template::render();
 }
开发者ID:hnmurugan,项目名称:Bonfire,代码行数:13,代码来源:settings.php

示例11: respuestaConsulta

 public function respuestaConsulta($array)
 {
     $obj = (object) $array;
     $usuario = Auth::UserAdmin();
     $template = new Template('consulta-response', array('asunto' => $obj->asunto, 'nombre' => $obj->nombre, 'apellido' => $obj->apellido, 'mensaje' => $obj->mensaje));
     $this->Body = $template->get();
     $this->send();
 }
开发者ID:EzequielDot175,项目名称:nufarm,代码行数:8,代码来源:class.mail.php

示例12: contactLogin

 private function contactLogin()
 {
     $vars = array();
     $form = self::contactForm();
     $vars = $form->getTemplate();
     $template = new \Template($vars);
     $template->setModuleTemplate('properties', 'contact_login.html');
     \Layout::add($template->get());
 }
开发者ID:par-orillonsoft,项目名称:phpwebsite,代码行数:9,代码来源:Contact_User.php

示例13: Error_505

 public static function Error_505($msg)
 {
     header('HTTP/1.1 503 Service Temporarily Unavailable');
     header('Status: 503 Service Temporarily Unavailable');
     header('Retry-After: 3600');
     $tpl = Template::get()->loadTemplate('error_page.tpl');
     echo $tpl->render(['message' => $msg]);
     exit;
 }
开发者ID:balucio,项目名称:smac,代码行数:9,代码来源:template.class.php

示例14: index

 /** 
  * function index
  *
  * list form data
  */
 function index()
 {
     Assets::add_js($this->load->view('settings/js', null, true), 'inline');
     Template::set('records', $this->permission_model->order_by('name')->find_all());
     Template::set('permission_header', '');
     if (!Template::get("toolbar_title")) {
         Template::set("toolbar_title", lang("permissions_manage"));
     }
     Template::render();
 }
开发者ID:nurulimamnotes,项目名称:Bonfire,代码行数:15,代码来源:settings.php

示例15: validate

 /**
  * Validate an Address to UPS AddressValidation API
  *
  * @access public
  * @param \Tigron\Ups\Address $address
  * @return array $response
  */
 public function validate(Address $address)
 {
     $template = Template::get();
     $template('zipcode', $address->zipcode);
     $template('city', $address->city);
     $template('country', $address->country);
     $xml = $template->render('call/AddressValidationRequest.twig');
     $result = $this->call('AV', $xml);
     return $result;
 }
开发者ID:tigron,项目名称:shipping-ups,代码行数:17,代码来源:AddressValidation.php


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