Home » HTML » HTML_Template_Flexy » Bug #2097
Using dynamic attributes w/ elements and vice versa
Details
| Request #2097 | Using dynamic attributes w/ elements and vice versa |
|---|---|
| Submitted | 2004-08-09 16:53 UTC |
| From | jwall at webpeak dot com |
| Status | Closed |
| Package | HTML_Template_Flexy |
| PHP Version | 4.3.8 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2004-08-09 16:53 UTC] jwall at webpeak dot com
Description:
------------
> Is it possible to manipulate a dynamic element which has a variable in it?
At the moment, they are mutally exclusive : -
use dynamic attributes: - cant use elements
use element : - cant use dynamic attributes..
The problem is that the elements are rendered as $this->element['name']->toHtml();
and the element have no knowledge of dynamic values.
It could be fixed I guess.. - probably worth filing as a bug.. (although fixes hapen faster with patches)
it would probably involve having attributes['xxxx'] = array('....', array('getVar','$t->.....')
and also passing $t to the object, so that it has something to render..
Reproduce code:
---------------
Template:
<mybutton id="CustomerButton" value="{customer.id}" flexy:dynamic="yes" />
Element Code:
$elements=$template->getElements();
foreach ($elements as $elementName => $element) {
if ($element->tag=='mybutton') {
$buttonAttributes=array(
'type'=>'button',
'onclick'=>"javascript:doSomething()"
);
$elements[$elementName]=new HTML_Template_Flexy_Element("input",
$buttonAttributes);
}
Expected result:
----------------
<input type="button" onclick="javascript:soSomething()" id="CustomerButton" value="26" />
Actual result:
--------------
<input type="button" onclick="javascript:soSomething()" id="CustomerButton" />