本文整理汇总了PHP中TemplatePower::newblock方法的典型用法代码示例。如果您正苦于以下问题:PHP TemplatePower::newblock方法的具体用法?PHP TemplatePower::newblock怎么用?PHP TemplatePower::newblock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TemplatePower
的用法示例。
在下文中一共展示了TemplatePower::newblock方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buscar
function buscar()
{
$tp = new TemplatePower("templates/hoteles.html");
$tp->prepare();
$tp->gotoBlock("_ROOT");
$mhotels = new MHotels();
if ($_POST['hotel'] == "") {
$tp->newblock("error");
$tp->assign("msg", "No se ha ingresado nada");
} else {
$result = $mhotels->buscar_hoteles($_POST['hotel']);
if ($result['found']) {
foreach ($result['result'] as $r) {
$tp->newblock("hotels");
$tp->assign("idHotel", $r['id_hotel']);
$tp->assign("name", $r['nom_hotel']);
$tp->assign("prov", $r['provincia']);
$tp->assign("local", $r['localidad']);
$tp->assign("calle", $r['calle']);
$tp->assign("ncalle", $r['nro_calle']);
$tp->assign("tel", $r['telefono']);
$tp->assign("precio", $r['precio_persona']);
}
} else {
$tp->newblock("no_hotels");
}
}
echo $tp->getOutputContent();
}
示例2: registrar
public function registrar()
{
$proteccion = new Proteccion();
$nombre = $proteccion->html($_POST['nombre']);
$apellido = $proteccion->html($_POST['apellido']);
$sexo = $proteccion->html($_POST['sexo']);
$fecha_nacimiento = $proteccion->html($_POST['fecha_nacimiento']);
$direccion = $proteccion->html($_POST['direccion']);
$email = $proteccion->html($_POST['email']);
$dni = $proteccion->html($_POST['dni']);
$pass = $proteccion->html($_POST['password']);
$persona = new Usuario($email, $pass);
$existe = $persona->existe();
if ($existe) {
$tp = new TemplatePower("templates/registro.html");
$tp->prepare();
$tp->gotoBlock("_ROOT");
$tp->newblock("no_registro");
$tp->assign("usuario", $email);
$webapp = $tp->getOutputContent();
} else {
$persona->setDatosUsuario($nombre, $apellido, $sexo, $fecha_nacimiento, $direccion, $dni);
$persona->insertar();
$_SESSION['user'] = $email;
$tp = new TemplatePower("templates/index.html");
$tp->prepare();
$tp->gotoBlock("_ROOT");
$tp->newBlock("sesion");
$tp->assign("usuario", $_SESSION['user']);
$webapp = $tp->getOutputContent();
}
echo $webapp;
}
示例3: BaseDatos
session_start();
include "inc.includes.php";
$db = new BaseDatos($config['dbhost'], $config['dbuser'], $config['dbpass'], $config['db']);
$tpl = new TemplatePower("templates/index.html");
$tpl->prepare();
$tpl->gotoBlock("_ROOT");
//isset determina si una variable esta definida o es null
//$_REQUEST tiene el contenido de get y post
if (!isset($_REQUEST["action"]) || $_REQUEST["action"] == "") {
$tpl->newBlock("contenido");
$mhotels = new MHotels();
$result = $mhotels->allhoteles();
if ($result['found']) {
foreach ($result['result'] as $r) {
$tpl->newblock("hotels");
$tpl->assign("idHotel", $r['id_hotel']);
$tpl->assign("name", $r['nom_hotel']);
$tpl->assign("prov", $r['provincia']);
$tpl->assign("local", $r['localidad']);
$tpl->assign("calle", $r['calle']);
$tpl->assign("ncalle", $r['nro_calle']);
$tpl->assign("tel", $r['telefono']);
$tpl->assign("precio", $r['precio_persona']);
}
} else {
$tpl->newblock("no_hotels");
}
$webapp = $tpl->getOutputContent();
} else {
if (!strpos($_REQUEST["action"], "::")) {
示例4: bajaHotel
public function bajaHotel()
{
$tp = new TemplatePower("templates/BajaHotel.html");
$tp->prepare();
$tp->gotoBlock("_ROOT");
$tp->newBlock("tabla");
$mhotels = new MHotels();
$result = $mhotels->allhoteles();
if ($result['found']) {
foreach ($result['result'] as $r) {
$tp->newblock("hotels");
$tp->assign("idHotel", $r['id_hotel']);
$tp->assign("name", $r['nom_hotel']);
$tp->assign("prov", $r['provincia']);
$tp->assign("local", $r['localidad']);
$tp->assign("calle", $r['calle']);
$tp->assign("ncalle", $r['nro_calle']);
$tp->assign("tel", $r['telefono']);
$tp->assign("precio", $r['precio_persona']);
}
} else {
$tp->newblock("no_hotels");
}
echo $tp->getOutputContent();
}
示例5: substr
include $abs . "inc/db.php";
include $abs . "inc/template.php";
## Pagina opbouwen
register_shutdown_function("output_page");
## Moet er een global-model pagina opgebouwd worden ?
if (is_integer($pos = strpos($template, "/"))) {
$globalTemplate = substr($template, 0, $pos) . "/";
$template = substr($template, $pos + 1, strlen($template));
}
if (empty($globalTemplate)) {
$tpl = new TemplatePower($abs . "tpl/" . $template . ".html");
} else {
$tpl = new TemplatePower($abs . "tpl/" . $globalTemplate . "global.html");
$tpl->assigninclude("include", $abs . "tpl/" . $globalTemplate . $template . ".html");
}
$tpl->prepare();
$tpl->assignglobal("url", $rel);
// Required for all pages
$qTijdschrift = "SELECT id, tijdschrift, waardering FROM tijdschrift";
$rTijdschrift = $sql->query($qTijdschrift);
if ($sql->num_rows($rTijdschrift) > 0) {
while ($tijdschrift = $sql->fetch_assoc($rTijdschrift)) {
if ($tijdschrift['waardering'] > 0) {
$tpl->newblock("w.tijdschrift");
$tpl->assign($tijdschrift);
}
$tpl->newblock("tijdschrift");
$tpl->assign($tijdschrift);
}
}
$tpl->gotoBlock('_ROOT');