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 #1071

Conditional Attributes

Details

Submitted2004-03-25 19:59 UTC
Fromahundiak at ingr dot com
StatusSuspended
PackageHTML_Template_Flexy
PHP VersionIrrelevant
OSLinux
Roadmaps(Not assigned)

Comments

[2004-03-25 19:59 UTC] ahundiak at ingr dot com

Description:
------------
I'd like to be able to control the selected attribute in the option element. Generate:
<option selected="selected">
With a template like this:
<option flexy:eval="{if:1}selected=#selected#{end:}">

The if:1 would of course be a test to see if you wanted the option to be selected. I think there would be other cases where it would be nice to conditionally add attributes to an element.

I know you can do this with the form element processing stuff. But I would like to avoid that for now.

[2004-03-29 19:59 UTC] ahundiak at ingr dot com

Thanks.
Raw is a start but a conditional would still be nice.
<option flexy:raw="{option.isSelected()}"
requires that the isSelected method return html code. I'd rather keep the html code in the template. Similiar issue with checked="checked".

Just consider this a feature request for a rainy day.