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


PHP RMTemplate::get_template方法代码示例

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


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

示例1: render

 /**
  * This method render the navigation bar with pages and all information.
  * Also creates the message "Shogin ..." that can be get after.
  * 
  * @param bool INdicates if this method must show the navbar or only render it
  * @return string|echo
  */
 public function render($caption, $showing = 0)
 {
     // If we have the content of render then return it
     if ($this->displayed) {
         return $this->rendered;
     }
     $total_pages = ceil($this->total_results / $this->items_page);
     $current_page = $this->current_page > $total_pages ? $total_pages : $this->current_page;
     $current_page = $current_page == 0 ? 1 : $current_page;
     $items_page = $this->items_page;
     $total_results = $this->total_results;
     $steps = $this->steps();
     $url = $this->url;
     if ($current_page == 1) {
         $first_element = 1;
     } else {
         $first_element = $total_results > 0 ? $current_page * $items_page - $items_page + 1 : 0;
     }
     $last_element = $current_page * $items_page;
     $last_element = $last_element > $total_results ? $total_results : $last_element;
     $this->showing = sprintf(__('Showing <strong>%u</strong> to <strong>%u</strong> of <strong>%u</strong>.', 'rmcommon'), $first_element, $last_element, $total_results);
     if ($total_pages <= 1) {
         return;
     }
     if ($showing) {
         $showing_legend = $this->showing;
     }
     ob_start();
     $start = 1;
     if ($current_page > $steps - 1) {
         $start = $current_page - floor($steps / 2);
     }
     //echo "$start>($total_pages - $steps) ? ($total_pages - $steps)+1 : $start;"; die();
     $start = $start >= $total_pages - $steps && $start != 1 ? $total_pages - $steps + 1 : $start;
     $start = $start < 1 ? 1 : $start;
     $end = $start + ($steps - 1);
     $end = $end > $total_pages ? $total_pages : $end;
     if ($this->template != '' && is_file($this->template)) {
         include $this->template;
     } else {
         include RMTemplate::get_template('navigation_pages.php', 'module', 'rmcommon');
     }
     $this->displayed = true;
     $this->rendered = ob_get_clean();
     return $this->rendered;
 }
开发者ID:laiello,项目名称:bitcero-modules,代码行数:53,代码来源:pagenav.php

示例2: display

 /**
  * Escribe directamente el conetnido HTML con la funcin echo
  */
 public function display($js = true)
 {
     $form =& $this;
     include RMTemplate::get_template('forms.php', 'rmcommon');
     //echo $this->render($js);
 }
开发者ID:laiello,项目名称:bitcero-modules,代码行数:9,代码来源:form.class.php


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