當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。