PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » HTML_QuickForm » Bug #5138

Radio element won't show up with ArraySmarty renderer

Details

Submitted2005-08-18 13:22 UTC
Fromgdalle at cg06 dot fr
AssignedThS
StatusBogus
PackageHTML_QuickForm
PHP Version4.3.8
OSWinXP
Roadmaps(Not assigned)

Comments

[2005-08-18 13:22 UTC] gdalle at cg06 dot fr

Description:
------------
Radio button aren't displayed when using the ArraySmarty renderer with a static smarty template.

Test script:
---------------
PHP :
set_include_path(get_include_path().";pear");
require_once("pear/html/QuickForm.php");
require_once("pear/html/QuickForm/Renderer/ArraySmarty.php");
require_once("smarty/libs/Smarty.class.php");

$oSmarty =& new Smarty;
$oSmarty ->template_dir = './templates';
$oSmarty ->compile_dir = './templates';

$oQuickForm = new HTML_QuickForm();
$oQuickForm->addElement("radio","QUESTION","Question","Yes","Y");
$oQuickForm->addElement("radio","QUESTION","Question","No","N");

$oRenderer =& new HTML_QuickForm_Renderer_ArraySmarty($oSmarty);
$oQuickForm->accept($oRenderer);
$oSmarty->assign("FORM_SAVE",$oRenderer->toArray());
$oSmarty->display('template.tpl');

Smarty Template :
<HTML><BODY>
<FORM {$FORM_SAVE.attributes}>
{$FORM_SAVE.QUESTION.label} : {$FORM_SAVE.QUESTION.html}</FORM>
</BODY></HTML>

Expected result:
----------------
The two radio button should be visible.

Actual result:
--------------
The two radio buttons aren't displayed.

[2005-08-19 07:20 UTC] gdalle at cg06 dot fr

Thanks for your help, it's good now !

Here is at this URL the print_r result of the renderer array :
http://webflore.free.fr/print_r.txt

I have a question about the label of the radio button : is it possible to add HTML attribute to the <LABEL> tag, in order to apply a specific CSS style ?
I would like to have the same with the method addElement and the parameter '$attributes'.