PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTML » HTML_Template_Flexy » Bug #5876

toJavascript not working on post request

Details

Submitted2005-11-05 22:51 UTC
Fromspam at electroteque dot org
StatusBogus
PackageHTML_Template_Flexy
PHP Version5.1.0
OSn/a
Roadmaps(Not assigned)

Comments

[2005-11-05 22:51 UTC] spam at electroteque dot org

Description:
------------
My toJavascript tag <flexy:toJavascript
releaseID="releaseID"></flexy:toJavascript> seems to not
work on a post request. What is happening is the
template is being reloaded from a post request if there
is a form validation error with FormBuilder. I am
setting the variable from a post variable, but i have
also tried a static string and returning null. What the
variable does is its being sent to a HTML_Ajax method to
display some records, but its null so is breaking the
method. What do i do ?

Expected result:
----------------
$this->releaseID = 3;

Actual result:
--------------
$this->releaseID = null;

[2005-11-06 08:36 UTC] spam at electroteque dot org

sorry, here you go, mind you im running 5.1RC1

<?php
require_once 'HTML/Template/Flexy.php';

class Test {

function Test()
{
$config = array('templateDir'=>'./
templates','compileDir'=>'./templates/
compile','compiler'=>'Flexy');
$this->tpl = new HTML_Template_Flexy($config);

$this->releaseID = ($_POST['releaseID'] ?
$_POST['relaseID'] : 3);
$this->tpl->compile('test.html');
echo $this->tpl->outputObject($this);
}
}

new Test;
?>

The template

<flexy:toJavascript releaseID="releaseID"></flexy:
toJavascript>
<form action="test1.php" method="post" >
<input type="hidden" name="releaseID" value="4">
<input type="submit" name="submit" value="Submit">
</form>

still comes up with null rather than the value of the
hidden element even though when i echo it its there ?

[2005-11-07 02:06 UTC] spam at electroteque dot org

sorry dude found my problem, the test was a typo however
in the real script when my setupform method was being
called after posting the variable was being set to a get
request not

$this->releaseID = ($_GET['releaseID'] ?
$_GET['releaseID'] : $_POST['releaseID']);