FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=9753&edit=1

ID: 9753
Updated by: gregory.currie@gmail.com
Reported By: pear-bug at andywaite dot com
Summary: Template rendering fails silently if invalid root
supplied
Status: Assigned
Type: Feature/Change Request
Package: HTML_Template_IT
Operating System: Mac OS X 10.4, probably others
Package Version: 1.2.1
PHP Version: 4.4.4
-Assigned To: dsp
+Assigned To: gregorycu
Roadmap Versions:
New Comment:

-Assigned To: dsp
+Assigned To: gregorycu



Previous Comments:
------------------------------------------------------------------------

[2008-01-10 03:27:34] najtje

You might want to look at:
http://pear.php.net/manual/en/core.pear.pear.seterrorhandling.php

BTW: Try this:
<?php
require_once('HTML/Template/IT.php');

PEAR::setErrorHandling(PEAR_ERROR_DIE);

$t = new HTML_Template_IT();
$t->loadTemplateFile('doesnotexist.tpl');

$t->touchBlock('__global__');
$t->show();
?>

------------------------------------------------------------------------

[2007-12-10 10:03:33] dsp

Hi,

I guess it fails silencly because IT is PHP4 and therefore cannot use
exceptions as needed to throw errors from a constructor.

We will change this in ITx2, but no in the current 1.2 branch.

------------------------------------------------------------------------

[2007-12-10 09:41:58] someone3x7

This isn't the only silent error. However, after a few hours of trying
to figure why some templates work and others don't and not finding
anything I've given up on this package.

------------------------------------------------------------------------

[2007-01-05 20:05:30] pear-bug at andywaite dot com

(correcting summary)

------------------------------------------------------------------------

[2007-01-05 20:04:20] pear-bug at andywaite dot com

Description:
------------
As summary.

'badpath' refers to a path on the system which does not exist or is
otherwise invalid.

Test script:
---------------
require_once "HTML/Template/IT.php";
$template = new HTML_Template_IT("./badpath");
$template->loadTemplatefile("test.tpl", false, true);
$template->setCurrentBlock("TESTBLOCK");
$template->setVariable("TESTPLACEHOLDER", "test");
$template->parseCurrentBlock();
$template->show();

Expected result:
----------------
An error/message reporting that 'badpath' does not exist.

Actual result:
--------------
Template renders as blank.

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedMar 1, '10 at 11:19a
activeMar 1, '10 at 11:19a
posts1
users1
websitepear.php.net

1 user in discussion

Gregory Currie: 1 post

People

Translate

site design / logo © 2022 Grokbase