本文整理汇总了PHP中tpl::render方法的典型用法代码示例。如果您正苦于以下问题:PHP tpl::render方法的具体用法?PHP tpl::render怎么用?PHP tpl::render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tpl
的用法示例。
在下文中一共展示了tpl::render方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderItem
public static function renderItem($message, $form_id, $type = 'error')
{
if (!$message) {
return '';
}
if (is_array($message)) {
foreach ($message as $key => &$item) {
$item = self::renderItem($item, $form_id, $type);
}
return $message;
} else {
$html = FALSE;
if ($message && ($options = id::decode($form_id))) {
$template = new tpl(tpl::find($type . '-message', $options), array('message' => $message));
$html = $template->render();
}
return $html;
}
}
示例2: switch
/**
*
*/
function switch_log($splitt, $to_list)
{
switch ($splitt[1]) {
case result_data:
foreach ($to_list[$splitt[0]]->result->data as $id1 => $value1) {
$outt .= '<li>' . $id1 . ': ' . $value1 . '</li>';
}
return '<pre>' . $outt . '</pre>';
break;
case server_info:
foreach ($to_list[$splitt[0]]->server_info as $id1 => $value1) {
$outt .= '<li>' . $id1 . ': ' . $value1 . '</li>';
}
return '<pre>' . $outt . '</pre>';
break;
case request_info:
foreach ($to_list[$splitt[0]]->request_info as $id1 => $value1) {
$outt .= '<li>' . $id1 . ': ' . $value1 . '</li>';
}
return '<pre>' . $outt . '</pre>';
break;
case env_info:
foreach ($to_list[$splitt[0]]->env_info as $id1 => $value1) {
$outt .= '<li>' . $id1 . ': ' . $value1 . '</li>';
}
return '<pre>' . $outt . '</pre>';
break;
case result_metadata_output:
$other = file_get_contents('createacct_log');
$to_list = array_reverse(json_decode($other), true);
foreach ($to_list[$splitt[0]]->result->metadata->output as $id1 => $value1) {
$outt .= '<li>' . $id1 . ': ' . $value1 . '</li>';
}
return '<pre>' . $outt . '</pre>';
break;
case cookie_info:
foreach ($to_list[$splitt[0]]->cookie_info as $id1 => $value1) {
$outt .= '<li>' . $id1 . ': ' . $value1 . '</li>';
}
return '<pre>' . $outt . '</pre>';
break;
case result_data:
foreach ($to_list[$splitt[0]]->result->data as $id1 => $value1) {
$outt .= '<li>' . $id1 . ': ' . $value1 . '</li>';
}
return '<pre>' . $outt . '</pre>';
break;
case query_string:
return htmlspecialchars($to_list[$splitt[0]]->query_string);
break;
case email_template:
$tpl = new tpl();
$previous_sends = '';
if (!empty($to_list[$splitt[0]]->data_mail)) {
$previous_sends = '<div class="col-md-12 alert alert-info" role="alert">Last sent: ' . date("Y-m-d H:i:s", $to_list[$splitt[0]]->data_mail->time) . " => " . $to_list[$splitt[0]]->data_mail->to . '</div>';
}
$client_email = isset($to_list[$splitt[0]]->request_info->contactemail) ? $to_list[$splitt[0]]->request_info->contactemail : 'none';
$data = array('item_id' => $splitt[0], 'txtarea_content' => $to_list[$splitt[0]]->email_template, 'previous_sends' => $previous_sends, 'client_email' => $client_email);
return $tpl->render($tpl->html_email_template_frame, $data);
break;
default:
break;
}
}
示例3: history
die;
}
break;
case 'open_tabs':
if (isset($_POST['open_tabs'])) {
$history = new history();
$rawlog = file_get_contents('createacct_log');
$records = array_reverse(json_decode($rawlog), true);
$reg[0] = $_POST['item_id'];
$tabs = array('email_template' => '', 'result_data' => '', 'server_info' => '', 'request_info' => '', 'env_info' => '', 'result_metadata_output' => '', 'cookie_info' => '', 'query_string' => '');
foreach ($tabs as $tab => $_null) {
$reg[1] = $tab;
$data[$tab] = $history->switch_log($reg, $records);
}
$tpl = new tpl();
echo $tpl->render($tpl->html_tabs_history, $data);
die;
}
break;
case 'delete_history_item':
if (isset($_POST['delete_history_item'])) {
$history = new history();
$history->delete_history_item();
}
break;
case 'textarea_email_template':
if (isset($_POST['textarea_email_template'])) {
$rawlog = file_get_contents('createacct_log');
$records = json_decode($rawlog);
$records[$_POST['mail_id']]->email_template = $_POST['textarea_email_template'];
$rawlog = json_encode($records);
示例4: tpl
/**
* Returns servers select
*/
function get_select_servers($servers)
{
$tpl = new tpl();
$options = '';
foreach ($servers as $idserver => $_null) {
$selected = $idserver == $_GET['serverid'] ? ' selected="selected" ' : '';
$options .= '<option value="' . $idserver . '" ' . $selected . '>' . $idserver . '</option>';
}
$data = array('options' => $options);
return $tpl->render($tpl->html_select_servers_short, $data);
// $data['html_select_servers_short'] = render($tpl->html_select_servers_short,$data);
// return render($tpl->html_select_servers, $data);
}
示例5: display_error
/**
* Utility functions
*
* @param $error_message
*/
function display_error($error_message)
{
$tpl = new tpl('error');
$tpl->set('error_message', $error_message);
echo $tpl->render();
}
示例6: tpl
<?php
require_once 'tpl/tpl.class.php';
$tpl = new tpl('./', 'tpl/tmp');
$tpl->tpl = 'My';
$tpl->num = 4815162342;
$tpl->post['page']['id'] = 316;
for ($i = 1; $i < 30; $i++) {
$tpl->bin[] = array('dec' => $i, 'bin' => decbin($i));
}
for ($i = 1; $i < 10; $i++) {
for ($j = 1; $j < 10; $j++) {
$tpl->table[$i]['row'][$j]['num'] = $i * $j;
}
}
$tpl->incfile = 'sm';
$tpl->render('template.html');
示例7: action_edit_module_settings
/**
* Called via ajax. Used to populate the popup where the user can set estimated work load on modules.
*/
function action_edit_module_settings()
{
$tpl = new tpl('edit_module_settings');
$tpl->set('modules', get_modules_for_user(LOADED_COURSE_ID));
$tpl->set('course_standard_module_hours', get_course_standard_module_hours(LOADED_COURSE_ID));
$tpl->set('user_standard_module_hours', get_user_standard_module_hours(LOADED_COURSE_ID));
echo $tpl->render();
}