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


PHP H2o::render方法代码示例

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


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

示例1: should_render_inherited_template

 public function should_render_inherited_template()
 {
     $h2o = new H2o('inherited.html', $this->option);
     expects($h2o->render())->should_be('header,extended body,footer');
     # extend nested blocks
     $h2o->loadTemplate('nested_inherit');
     expects($h2o->render())->should_be('h2o template rocks so hard ! and plays so hard');
 }
开发者ID:tonjoo,项目名称:tiga-framework,代码行数:8,代码来源:inheritance_spec.php

示例2: should_be_able_to_load_template_lazily

 public function should_be_able_to_load_template_lazily()
 {
     $h2o = new H2o('a.html', array('searchpath' => 'templates'));
     expects($h2o->render())->should_not_be_empty();
     $h2o = new H2o(null, array('searchpath' => 'templates'));
     $h2o->loadTemplate('b.html');
     expects($h2o->render())->should_not_be_empty();
 }
开发者ID:tonjoo,项目名称:tiga-framework,代码行数:8,代码来源:loader_spec.php

示例3: should_be_able_to_include_in_nested_fashion

 public function should_be_able_to_include_in_nested_fashion()
 {
     $h2o = new H2o('page.html', $this->option);
     $result = $h2o->render();
     expects($result)->should_match('/layout text/');
     expects($result)->should_match('/Page footer/');
     expects($result)->should_match('/page menu/');
 }
开发者ID:tonjoo,项目名称:tiga-framework,代码行数:8,代码来源:include_spec.php

示例4: render

 /**
  * Renders a template using h2o
  *
  * @param string $template template file name
  * @return string
  */
 public function render($template)
 {
     if (!array_key_exists('searchpath', self::$h2o_options)) {
         self::$h2o_options['searchpath'] = $this->getTemplatesDirectory() . '/';
     }
     $this->_load_h2o();
     $h2o = new \H2o($template, self::$h2o_options);
     return $h2o->render($this->data);
 }
开发者ID:Alexander173,项目名称:angular-noCaptcha-reCaptcha,代码行数:15,代码来源:H2o.php

示例5: get_display_list

 public function get_display_list()
 {
     global $include_path, $scan_request_scripts;
     $tpl = $include_path . '/templates/scan_request/scan_requests_list.tpl.html';
     if (file_exists($include_path . '/templates/scan_request/scan_requests_list_subst.tpl.html')) {
         $tpl = $include_path . '/templates/scan_request/scan_requests_list_subst.tpl.html';
     }
     $h2o = new H2o($tpl);
     return $scan_request_scripts . $h2o->render(array('scan_requests' => $this));
 }
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:10,代码来源:scan_requests.class.php

示例6: render

 /**
  * Renders a template using h2o
  *
  * @param string $template template file name
  * @return string
  */
 public function render($template)
 {
     if (!array_key_exists('searchpath', $this->h2o_options)) {
         $this->h2o_options['searchpath'] = $this->getTemplatesDirectory() . '/';
     }
     // Make sure H2o is loaded
     $this->_load_h2o();
     $h2o = new H2o($template, $this->h2o_options);
     return $h2o->render($this->data);
 }
开发者ID:rubberneck,项目名称:slim-extras,代码行数:16,代码来源:H2o.php

示例7: chdir

 function should_be_able_to_load_template_lazily()
 {
     chdir(dirname(__FILE__));
     $paths = array(dirname(__FILE__) . DS . 'templates' . DS);
     $h2o = h2o('a.html', array('searchpath' => $paths));
     expects($h2o->render())->should_not_be_empty();
     $h2o = new H2o('a.html', array('searchpath' => 'templates'));
     expects($h2o->render())->should_not_be_empty();
     $h2o = new H2o(null, array('searchpath' => 'templates'));
     $h2o->loadTemplate('b.html');
     expects($h2o->render())->should_not_be_empty();
 }
开发者ID:JSilva,项目名称:h2o-php,代码行数:12,代码来源:loader_spec.php

示例8: generate_authority

 /**
  * Permet de générer l'affichage d'un élément de liste de type autorité
  * @param authority $authority
  * @param bool $recherche_ajax_mode
  * @param int $group_id Identifiant du groupe
  * @return string 
  */
 private function generate_authority($authority, $recherche_ajax_mode, $group_id)
 {
     global $include_path;
     $template_path = $include_path . '/templates/authorities/list/' . $authority->get_string_type_object() . '.html';
     if (file_exists($include_path . '/templates/authorities/list/' . $authority->get_string_type_object() . '_subst.html')) {
         $template_path = $include_path . '/templates/authorities/list/' . $authority->get_string_type_object() . '_subst.html';
     }
     if (file_exists($template_path)) {
         $h2o = new H2o($template_path);
         $context = array('list_element' => $authority, 'group_id' => $group_id);
         return $h2o->render($context);
     }
     return '';
 }
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:21,代码来源:elements_authorities_list_ui.class.php

示例9: get_isbd

 public function get_isbd()
 {
     global $msg, $include_path;
     $template_path = $include_path . '/templates/authorities/isbd/titre_uniforme.html';
     if (file_exists($template_path)) {
         $h2o = new H2o($template_path);
         $authority = new authority(0, $this->id, AUT_TABLE_TITRES_UNIFORMES);
         return $h2o->render(array('oeuvre' => $authority));
     }
     return $this->tu_isbd;
 }
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:11,代码来源:titre_uniforme.class.php

示例10: array

<?php

/**
 *   Simple example rendering a user list
 *   ------------------------------------
 *   
 *   @credit - adapt from ptemplates sample
 */
require '../../h2o.php';
$template = new H2o('index.html', array('cache_dir' => dirname(__FILE__)));
$time_start = microtime(true);
echo $template->render(array('users' => array(array('username' => 'peter <h1>asdfasdf</h1>', 'tasks' => array('school', 'writing'), 'user_id' => 1), array('username' => 'anton', 'tasks' => array('go shopping <h1>je</h1'), 'user_id' => 2), array('username' => 'john doe', 'tasks' => array('write report', 'call tony', 'meeting with arron'), 'user_id' => 3), array('username' => 'foobar', 'tasks' => array(), 'user_id' => 4))));
echo "in " . (microtime(true) - $time_start) . " seconds\n<br/>";
开发者ID:paudebau,项目名称:h2o-php,代码行数:13,代码来源:index.php

示例11: render

 public function render($context = array())
 {
     global $opac_authorities_templates_folder;
     if (!$opac_authorities_templates_folder) {
         $opac_authorities_templates_folder = "./includes/templates/authorities/common";
     }
     $template_path = $opac_authorities_templates_folder . "/" . $this->get_type_autority() . ".html";
     if (!file_exists($template_path)) {
         $template_path = "./includes/templates/authorities/common/" . $this->get_type_autority() . ".html";
     }
     if (file_exists($opac_authorities_templates_folder . "/" . $this->get_type_autority() . "_subst.html")) {
         $template_path = $opac_authorities_templates_folder . "/" . $this->get_type_autority() . "_subst.html";
     }
     if (file_exists($template_path)) {
         $h2o = new H2o($template_path);
         $h2o->addLookup(array($this, "lookup"));
         echo $h2o->render($context);
     }
 }
开发者ID:hogsim,项目名称:PMB,代码行数:19,代码来源:authority.class.php

示例12: do_carroussel

                            $resas_datas['flag_resa_possible'] = false;
                        }
                        if ($opac_show_exemplaires) {
                            $obj['display_expls'] = pmb_bidi(notice_affichage::expl_list("m", 0, $id));
                        }
                    } else {
                        $resas_datas['flag_resa_visible'] = false;
                    }
                    // On envoie le tout au template
                    if (file_exists($include_path . "/templates/record/" . $opac_notices_format_django_directory . "/bulletin_without_record_extended_display.tpl.html")) {
                        $template = $include_path . "/templates/record/" . $opac_notices_format_django_directory . "/bulletin_without_record_extended_display.tpl.html";
                    } else {
                        $template = $include_path . "/templates/record/common/bulletin_without_record_extended_display.tpl.html";
                    }
                    $h2o = new H2o($template);
                    print $h2o->render(array('bulletin' => $obj, 'parent' => $notice3, 'liens_opac' => $liens_opac, 'resas_datas' => $resas_datas));
                }
            }
        }
    }
}
pmb_mysql_free_result($resdep);
function do_carroussel($bull)
{
    global $gestion_acces_active, $gestion_acces_empr_notice, $opac_navigateur_bulletin_number;
    global $msg;
    if ($gestion_acces_active == 1 && $gestion_acces_empr_notice == 1) {
        $ac = new acces();
        $dom_2 = $ac->setDomain(2);
        $join_noti = $dom_2->getJoin($_SESSION["id_empr_session"], 4, "bulletins.num_notice");
        $join_bull = $dom_2->getJoin($_SESSION["id_empr_session"], 4, "bulletins.bulletin_notice");
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:31,代码来源:bulletin_display.inc.php

示例13: render

 private static function render($notice_id, $tpl)
 {
     $h2o = new H2o($tpl);
     $h2o->addLookup("record_display::lookup");
     $h2o->set(array('notice_id' => $notice_id));
     return $h2o->render();
 }
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:7,代码来源:record_display.class.php

示例14: array

<?php

include_once "h2o/h2o.php";
$tpl = new H2o("index.tpl.html", array('cache_dir' => dirname(__FILE__)));
$arr = array("grid" => "Grilla", "grid_config" => "Configuraci&oacute;n de la grilla", "home" => "Inicio", "edit" => "Edición", "attention" => "Atención", "delete" => "eliminar", "move" => "Drag", "insert" => "Insertar", "information" => "Información general", "save" => "Guardar", "safe_ok" => "Guardado Correctamente", "block_functions" => "Bloque de Funciones", "by_default" => "Por defecto", "info_msg" => "Información", "info_dialog" => "Dialogo de Informacion", "warning_msg" => "Advertencia", "micro_count" => "Contador", "title_bar" => "Barra de Titulo", "disable" => "Desactivar", "bordered" => "Sombreado", "page_title" => "Titulo de Pagina", "rich_text" => "Texto", "preview_list" => "Lista de Vista Previa", "progress_bar" => "Barra de Progreso", "notice" => "Noticias", "title" => "Titulo", "dynamic_components" => "Componentes Dinamicos", "accordion" => "Acordion", "ready" => "Exito", "slider" => "Carrusel", "developer" => "Desarrollador", "preview" => "Vista previa", "undo" => "Deshacer", "clean" => "Limpiar", "download" => "Descargar", "save" => "Guardar", "design" => "Diseño", "redo" => "Rehacer", "function" => "Funcion", "basic" => "Basico", "error_msg" => "Error", "left_alig" => "Alinear a la Izq.", "right_align" => "Alinear a la Der.", "bottom" => "Fondo", "Center" => "Centrar", "title_list" => "Lista de Tit.", "help" => "Ayuda", "table" => "Tabla", "align" => "Alinear", "no_style" => "Sin Estilo", "style" => "Estilo", "mark" => "Marca", "reference_block" => "Bloque de Referencia", "vertical_align" => "Alineación vertical", "with_line" => "Alineación vertical", "button" => "Boton", "button_group" => "Grupo de Botones", "size" => "Tamaño", "large" => "Largo", "small" => "Pequeño", "disable" => "Deshabilitar", "enable" => "Habilitar", "danger" => "Peligro", "inverse" => "Inverso", "warning" => "Advertencia", "mini" => "Mini", "normal" => "Normal", "extend" => "Extendido", "res_1" => "Cerrar", "res_2" => "Ancho fijo", "res_3" => "Ancho adaptable", "res_4" => "HTML limpia generada a continuación, puede copiar y pegar el código en su proyecto.", "res_5" => "Descargar", "res_6" => "Cerrar", "res_7" => "Guardar", "res_8" => "Debido a que el cielo no es el más hermoso.", "res_9" => "Cada vez mirando las estrellas, siempre cierro los ojos,", "res_10" => "Un muro de contención, sólo una bahía cubra su galaxia.", "res_11" => "Un viento, simplemente pasear en un valle;", "res_12" => "Bajo construcción ...", "res_13" => "Extensión de aplicación", "res_14" => "Andar en bicicleta como una herramienta para que coincida con la velocidad del deporte.1896 fue de los primeros Juegos Olímpicos como un evento oficial.Tour de Francia como Campeonato de ciclismo más famosos del mundo.", "res_15" => "Bicicleta", "res_16" => "Surfeando las olas son impulsados ​​por sus excelentes habilidades y equilibrio, una campaña de lucha contra las olas.Los jugadores se colocan en una tabla de surf, o usan la web, tableros de rodillas, alfombras de goma inflables, remo, kayak y otros deportes acuáticos para controlar una ola.", "res_17" => "Navegar", "res_18" => "El béisbol es un tipo de palo de jugar como las principales características de los colectivos altamente confrontacionales proyectos, juegos de pelota en los Estados Unidos, Japón, es particularmente popular.", "res_19" => "Béisbol", "msg_1" => "Tenga en cuenta que su privacidad personal.");
echo $tpl->render($arr);
开发者ID:Cywaithaka,项目名称:S.A.F.E.-Open-Source-Microfinance-Suite,代码行数:6,代码来源:index.php

示例15: render

 /**
  * renders the template in the given context
  * 
  * @param $context array or object of context
  * @return string the rendered template
  */
 public function render($context = array())
 {
     return $this->template->render($context);
 }
开发者ID:jbzdak,项目名称:wikidot,代码行数:10,代码来源:Template.php


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