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


PHP Template::render方法代码示例

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


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

示例1: __construct

 public function __construct($content)
 {
     $template = new Template();
     $template->vars = $content;
     $this->html = $template->render('html.tpl.php');
     $this->header = $template->render('header.tpl.php');
     $this->body = $template->render('body.tpl.php');
     $this->footer = $template->render('footer.tpl.php');
 }
开发者ID:ddobrev81,项目名称:choose-mvc,代码行数:9,代码来源:Page.php

示例2: renderfile

function renderfile($file)
{
    $view = new Template();
    $view->navbar = $view->render('navbar_v.php');
    $view->title = "Login";
    $view->content = $view->render($file);
    echo $view->render('main.php');
    return $view;
}
开发者ID:MOGP95,项目名称:ET3,代码行数:9,代码来源:render_helper.php

示例3: send

 public function send($address, $subject)
 {
     if ($this->active) {
         $headers = $this->getHeaders();
         $this->mail($address, $subject, $this->template->render($this->data), $headers, '-f blspark1@gmail.com');
     } else {
         echo $this->template->render($this->data);
     }
 }
开发者ID:baruchlane,项目名称:groupme-bots,代码行数:9,代码来源:Emailer.php

示例4: indexAction

 public function indexAction()
 {
     $this->_template = new Template();
     $this->_template->url = './index.php';
     $this->_template->lang = $this->_lang;
     $this->_template->dictionary = $this->_dictionary;
     $this->_template->wwwRoot = $this->_wwwRoot;
     if ($this->_lang == 'ru') {
         $this->_template->license = file_get_contents('./templates/gpl-3.0_ru.txt');
     } else {
         $this->_template->license = file_get_contents('./templates/gpl-3.0_en.txt');
     }
     echo $this->_template->render('./templates/install.php');
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:14,代码来源:Controller.php

示例5: index

	public function index() 
	{
		if ($this->config->item('updates.do_check'))
		{
			$this->load->library('GitHub_lib');
			$this->load->helper('date');
		
			// Latest commits
			Template::set('commits', $this->github_lib->user_timeline('ci-bonfire', 'Bonfire'));
			
			$tags = $this->github_lib->repo_refs('ci-bonfire', 'Bonfire');
	
			$version = 0.0;
	
			foreach ($tags as $tag => $ref)
			{
				if ($tag > $version)
				{
					$version = $tag;
				}
			}
			
			Template::set('update_message', 'You are running Bonfire version <b>'. BONFIRE_VERSION .'</b>. The latest available version is <b>'. $version .'</b>.');
		}
	
		Template::render();
	}
开发者ID:ndcisiv,项目名称:Bonfire,代码行数:27,代码来源:developer.php

示例6: index

 /**
  * Display the available shortcuts and the details of the keys setup for
  * these shortcut options.
  *
  * Manages adding, editing and deleting of the shortcut keys.
  *
  * @return void
  */
 public function index()
 {
     if (isset($_POST['add_shortcut'])) {
         if ($this->add()) {
             Template::set_message(lang('ui_shortcut_success'), 'success');
         } else {
             Template::set_message(lang('ui_shortcut_add_error'), 'error');
         }
     } elseif (isset($_POST['remove_shortcut'])) {
         if ($this->remove()) {
             Template::set_message(lang('ui_shortcut_remove_success'), 'success');
         } else {
             Template::set_message(lang('ui_shortcut_remove_error'), 'error');
         }
     } elseif (isset($_POST['save'])) {
         if ($this->save_settings()) {
             Template::set_message(lang('ui_shortcut_save_success'), 'success');
         } else {
             Template::set_message(lang('ui_shortcut_save_error'), 'error');
         }
     }
     // Read available shortcuts from the application config
     Template::set('current', config_item('ui.current_shortcuts'));
     Template::set('settings', $this->settings_lib->find_all_by('module', 'core.ui'));
     Template::set('toolbar_title', lang('ui_shortcuts'));
     Template::render();
 }
开发者ID:brkrishna,项目名称:freelance,代码行数:35,代码来源:settings.php

示例7: add_category

 public function add_category()
 {
     $data = array();
     Template::set_view('v_category_add');
     Template::set($data);
     Template::render();
 }
开发者ID:lhzhou,项目名称:CodeIgniter_RESTful_API,代码行数:7,代码来源:Category.php

示例8: index

 public function index()
 {
     if ($this->input->post('submit')) {
         if ($this->save_settings()) {
             Template::set_message(lang('mod_settings_saved'), 'success');
             redirect(SITE_AREA . '/settings/comments');
         } else {
             Template::set_message(lang('md_settings_error'), 'error');
         }
     }
     // Read our current settings
     $settings = $this->settings_model->select('name,value')->find_all_by('module', 'comments');
     Template::set('settings', $settings);
     if (!isset($this->role_model)) {
         $this->load->model('roles/role_model');
     }
     $roles = array();
     $tmpRoles = $this->role_model->select('role_id, role_name, default')->where('deleted', 0)->find_all();
     if (isset($tmpRoles) && is_array($tmpRoles) && count($tmpRoles)) {
         foreach ($tmpRoles as $role) {
             $roles = $roles + array($role->role_id => $role->role_name);
         }
     }
     Template::set('roles', $roles);
     Template::set('toolbar_title', lang('mod_settings_title'));
     Template::set_view('comments/settings/index');
     Template::render();
 }
开发者ID:brkrishna,项目名称:freelance,代码行数:28,代码来源:settings.php

示例9: main

 public static function main($tmplData)
 {
     //echo "Render::main()";
     global $ini;
     $tmplData['{{content}}'] = Template::render($ini['mainTemplate'], $tmplData);
     Template::display($ini['layoutTemplate'], $tmplData);
 }
开发者ID:Kloadut,项目名称:phpFileManager,代码行数:7,代码来源:Render.php

示例10: index

 public function index()
 {
     if ($this->settings_lib->item('updates.do_check') && function_exists('curl_version')) {
         $this->load->library('GitHub_lib');
         $this->load->helper('date');
         // Latest commits
         Template::set('commits', $this->github_lib->user_timeline('ci-bonfire', 'Bonfire', 'develop'));
         $tags = $this->github_lib->repo_refs('ci-bonfire', 'Bonfire');
         $version = 0.0;
         if (is_object($tags) && count($tags)) {
             foreach ($tags as $tag => $ref) {
                 if ($tag > $version) {
                     $version = $tag;
                 }
             }
             if (BONFIRE_VERSION === $version) {
                 Template::set('update_message', 'You are running Bonfire version <b>' . BONFIRE_VERSION . '</b>. This is the latest available version of Bonfire.');
             } else {
                 Template::set('update_message', 'You are running Bonfire version <b>' . BONFIRE_VERSION . '</b>. The latest <b>stable</b> version available is <b>' . $version . '</b>.');
             }
         } else {
             Template::set('update_message', 'You are running Bonfire version <b>' . BONFIRE_VERSION . '</b>. <b>Unable to retrieve the latest version at this time.</b>');
         }
     }
     Template::render();
 }
开发者ID:nazrulworld,项目名称:Bonfire,代码行数:26,代码来源:developer.php

示例11: edit

 public function edit()
 {
     $this->load->library('form_validation');
     $server_type = $this->uri->segment(5);
     if ($this->input->post('submit')) {
         $this->form_validation->set_rules('server_type', lang('db_server_type'), 'required|trim|max_length[20]|xss_clean');
         $this->form_validation->set_rules('hostname', lang('db_hostname'), 'required|trim|max_length[120]|xss_clean');
         $this->form_validation->set_rules('database', lang('db_dbname'), 'required|trim|max_length[120]|xss_clean');
         $this->form_validation->set_rules('username', lang('bf_username'), 'trim|xss_clean');
         $this->form_validation->set_rules('password', lang('bf_password'), 'trim|xss_clean');
         if ($this->form_validation->run() !== FALSE) {
             unset($_POST['server_type'], $_POST['submit']);
             if (write_db_config(array($server_type => $_POST)) == TRUE) {
                 Template::set_message(lang('db_successful_save'), 'success');
                 $this->activity_model->log_activity($this->auth->user_id(), $server_type . ' : ' . lang('db_successful_save_act'), 'database');
             } else {
                 Template::set_message(lang('db_erroneous_save'), 'error');
                 $this->activity_model->log_activity($this->auth->user_id(), $server_type . ' : ' . lang('db_erroneous_save_act'), 'database');
             }
         }
     }
     $settings = read_db_config($server_type);
     if (!empty($settings)) {
         Template::set('db_settings', $settings[$server_type]);
     }
     Template::set('server_type', $server_type);
     Template::render();
 }
开发者ID:nurulimamnotes,项目名称:Bonfire,代码行数:28,代码来源:settings.php

示例12: build

    /**
	 * Builds the control
	 *
	 * @return string
	 */
	public function build()
	{
		$result='';

		$this->rows=$this->get_data();		

		$rendered='';
		$this->count=0;		

		if (($this->rows!=null) && ($this->item_template!=null))
		{
			$template=new Template(PATH_APP.'view/'.$this->item_template.EXT);

			foreach($this->rows as $row)
			{
				$rendered.=$template->render(array('item' => $row, 'control' => $this, 'count' => $this->count, 'total_count'=>$this->total_count));
				
				$this->current=&$row;
				$this->current_index=$this->count++;
			}
		}

		if ($this->container_template!=null)
		{
			$view=new Template(PATH_APP.'view/'.$this->container_template.EXT);
			$result=$view->render(array('total_count'=>$this->total_count, 'count'=>$this->count, 'control' => $this, 'content' => $rendered));
		}
		else
			$result=$rendered;

		return $result;
	}
开发者ID:jawngee,项目名称:Thor,代码行数:37,代码来源:repeater.php

示例13: render

 /**
  * Render
  * 
  * @param type $template 
  */
 public function render($template = NULL)
 {
     $template or $template = $this->template;
     $tpl = new Template($template);
     $tpl->item = $this;
     return $tpl->render();
 }
开发者ID:romartyn,项目名称:cogear,代码行数:12,代码来源:Item.php

示例14: modmanifest

 public function modmanifest()
 {
     // load the models
     if (isset($_POST['submit'])) {
         $showSpecies = $this->input->post('chkShowSpecies', true);
         $showGender = $this->input->post('chkShowGender', true);
         $showThumbnail = $this->input->post('chkShowThumbnail', true);
         $setting_data = array('setting_value' => $showSpecies);
         $update_settings = $this->settings->update_setting('modManifest_show_species', $setting_data);
         $setting_data = array('setting_value' => $showGender);
         $update_settings = $this->settings->update_setting('modManifest_show_gender', $setting_data);
         $setting_data = array('setting_value' => $showThumbnail);
         $update_settings = $this->settings->update_setting('modManifest_show_thumbnail', $setting_data);
         $message = "Settings updated sucessfully.";
         $flash['status'] = 'success';
         $flash['message'] = text_output($message);
     }
     $data['checkboxes']['show_species'] = array('name' => 'chkShowSpecies', 'id' => 'chkShowSpecies', 'value' => 'true');
     $data['checkboxes']['show_gender'] = array('name' => 'chkShowGender', 'id' => 'chkShowGender', 'value' => 'true');
     $data['checkboxes']['show_thumbnail'] = array('name' => 'chkShowThumbnail', 'id' => 'chkShowThumbnail', 'value' => 'true');
     $set_species = $this->settings->get_setting('modManifest_show_species');
     $set_gender = $this->settings->get_setting('modManifest_show_gender');
     $set_thumbnail = $this->settings->get_setting('modManifest_show_thumbnail');
     $data['temp'] = $set_species;
     $data['checkboxes']['show_species']['checked'] = $set_species;
     $data['checkboxes']['show_gender']['checked'] = $set_gender;
     $data['checkboxes']['show_thumbnail']['checked'] = $set_thumbnail;
     $data['submit'] = array('type' => 'submit', 'class' => 'button-main', 'name' => 'submit', 'value' => 'submit', 'content' => ucwords(lang('actions_submit')));
     $data['header'] = "Manifest Details Configuration";
     $view_loc = "admin_modmanifest";
     $this->_regions['content'] = Location::view($view_loc, $this->skin, 'admin', $data);
     $this->_regions['title'] .= $data['header'];
     Template::assign($this->_regions);
     Template::render();
 }
开发者ID:rajeltomari,项目名称:Manifest-Details,代码行数:35,代码来源:admin.php

示例15: render

		public function render()
		{
			// Get Template and Page
			if (!file_exists(BASEPATH.'/app/views/'.Routes::getController().'/'.Routes::getMethod().'.php'))
				trigger_error('View file "'.Routes::getController().'/'.Routes::getMethod().'.php" was not found.');
      Template::render($this->vars, true);
		}
开发者ID:nickbarth,项目名称:PHP-Tofu,代码行数:7,代码来源:controller.php


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