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

An extremely powerful Tokenizer driven Template engine

This package is unmaintained.

Download latest release 1.3.13 (archived versions might be outdated)

License: PHP License

Description

HTML_Template_Flexy started it's life as a simplification of HTML_Template_Xipe,
however in Version 0.2, It became one of the first template engine to use a real Lexer,
rather than regex'es, making it possible to do things like ASP.net or Cold Fusion tags.
However, it still has a very simple set of goals.
- Very Simple API,
o easy to learn...
o prevents to much logic going in templates
- Easy to write document'able code
o By using object vars for a template rather than 'assign', you
can use phpdoc comments to list what variable you use.
- Editable in WYSIWYG editors
o you can create full featured templates, that doesnt get broken every time you edit with
Dreamweaver(tm) or Mozilla editor
o Uses namespaced attributes to add looping/conditionals
- Extremely Fast,
o runtime is at least 4 time smaller than most other template engines (eg. Smarty)
o uses compiled templates, as a result it is many times faster on blocks and loops than
than Regex templates (eg. IT/phplib)
- Safer (for cross site scripting attacks)
o All variables default to be output as HTML escaped (overridden with the :h modifier)
- Multilanguage support
o Parses strings out of template, so you can build translation tools
o Compiles language specific templates (so translation is only done once, not on every request)
- Full dynamic element support (like ASP.NET), so you can pick elements to replace at runtime

Features:
- {variable} to echo $object->variable
- {method()} to echo $object->method();
- {foreach:var,key,value} to PHP foreach loops
- tag attributes FLEXY:FOREACH, FLEXY:IF for looping and conditional HTML inclusion
- {if:variable} to PHP If statement
- {if:method()} to PHP If statement
- {else:} and {end:} to close or alternate If statements
- FORM to HTML_Template_Flexy_Element's
- replacement of INPUT, TEXTAREA and SELECT tags with HTML_Template_Flexy_Element code
use FLEXY:IGNORE (inherited) and FLEXY:IGNOREONLY (single) to prevent replacements
- FLEXY:START/FLEXY:STARTCHILDREN tags to define where template starts/finishes
- support for urlencoded braces {} in HTML attributes.
- documentation in the pear manual

- examples at http://svn.php.net/pear/packages/HTML_Template_Flexy/trunk/tests/

Documentation

Manual

Maintainers

Dependencies

Required

Optional

Releases

Bugs

IDStatusTypeVersionDateSummary
#60ClosedBug2003-10-04varname error (and limitation)
#84ClosedBug2003-10-09Lexing of method arguments off-by-one
#90Wont fixBug2003-10-12Whitespace Trailing Substitution Eaten
#204No FeedbackBug2003-11-06<textarea>: "Dynamic tags require an ID value"?
#460ClosedBug2003-12-19static in SELECT tag
#615ClosedBug2004-01-23Constructor attempt to return PEAR_Error
#643ClosedBug2004-01-29compileDir issue
#793ClosedBug2004-02-18flexy:foreach="on" with single arg = compile error
#809ClosedBug2004-02-20to many --'s closing comment confuse parser
#847ClosedBug2004-02-24string arguments with , fail.. in attributes
#875ClosedBug2004-02-26PEAR QA: improvement for get_class()-usage
#1071SuspendedBug2004-03-25Conditional Attributes
#1115ClosedBug2004-04-02More than one template
#1120ClosedBug2004-04-02auto detect flexy variables, to prevent element conversion.
#1138VerifiedReq2004-04-05Request flexy:while attribute
#1228ClosedBug2004-04-16PHP allowing not work
#1247AssignedReq2004-04-20Some new feature request (Docs missing - toJavascript etc.)
#1272ClosedReq2004-04-23Request emptyCompiledTemplateDir
#1273No FeedbackBug2004-04-23Request flexy:id attribute
#1274ClosedBug2004-04-23Request NonStrict Option
#1275ClosedBug2004-04-23XHTML Output
#1310ClosedBug2004-04-29{if:GLOBALS.is_array(v)} doesn't work
#1331No FeedbackBug2004-05-03JavaScript code
#1346No FeedbackBug2004-05-05Same name template
#1351VerifiedReq2004-05-06Complex arguments
#1381ClosedBug2004-05-11dynamic form elements can not be conditional tag?
#1409ClosedBug2004-05-14Single element foreach
#1458ClosedBug2004-05-20Parsing failes with attibutes using underscore
#1675ClosedBug2004-06-18post_fix_php_cr() in Mail.php doesn't work with windows linebreaks
#1753ClosedBug2004-06-30SmartyConvertor compiler doesn't work
#1817ClosedBug2004-07-07Introduction example does not work
#1967No FeedbackReq2004-07-23Use of PCRE functions
#1974VerifiedReq2004-07-24IF conditions like x=="a"
#2074ClosedReq2004-08-06template methods with integer parameters
#2093Wont fixReq2004-08-09Use of prefix/suffix with form tags
#2097ClosedReq2004-08-09Using dynamic attributes w/ elements and vice versa
#2145ClosedReq2004-08-17foreach variables lose scope
#2170ClosedBug2004-08-20Just a spelling mistake
#2244SuspendedReq2004-08-29call methods in function call and foreach loops
#2258VerifiedReq2004-08-31can not specify Translation2 option parameters
#2304ClosedDoc2004-09-09Need minor global changes to documentation
#2355BogusBug2004-09-17PHP crashes with form and many nested tags inside template
#2465ClosedReq2004-10-05flexy: toStyle addition
#2655VerifiedReq2004-10-31Sub variable in the variable
#2804ClosedBug2004-11-22setOptions optgroup
#2959ClosedBug2004-12-13%s where template output should be
#2997AssignedReq2004-12-20Request: Flexy - custom tag handler
#3003ClosedBug2004-12-21{var} replaced with %s
#3024VerifiedReq2004-12-23[DOC] - note that foreach scopes differently than PHP
#3041ClosedBug2004-12-27Token.php raises a notice on line 417
#3129ClosedBug2005-01-06setRequired needs pass by reference arg
#3145ClosedBug2005-01-10typo in parseTagInput()
#3280ClosedReq2005-01-24API documentation
#3385ClosedBug2005-02-05HTML_Element_Factory::setRequired() discards elements
#3397SuspendedBug2005-02-07Warning Notices
#3685No FeedbackBug2005-03-03var named "elements" is not inherited in included template
#3946ClosedBug2005-03-24flexy:raw invalid compile result
#3971Wont fixReq2005-03-27{if:variable} statement misinterpretation
#4005No FeedbackBug2005-03-30PHP5.0.2 + HTML_Template_Flexy 1.2.1, form checkbox element not working
#4103ClosedBug2005-04-08Wrong URLs in Form-Actions
#4140No FeedbackBug2005-04-14getModifierWrapper don't return plugin method
#4298VerifiedReq2005-05-06Fancy HTML stuff needs documenting.. (Request for HTML attributes with no value)
#4330Wont fixBug2005-05-11Placeholder in HTML tags result in syntax error
#4405OpenReq2005-05-22Patch to allow overriding variable names in included templates
#4686BogusBug2005-06-26Template vars inside HTML <script> tags are ignored
#4687BogusBug2005-06-26Dynamic generated form elements are ignored
#4838BogusBug2005-07-15Variable inside flexy:foreach did nto work as expected
#4886ClosedReq2005-07-22Please update the docs
#5267ClosedBug2005-09-01checkbox (array) id attribute error
#5752ClosedReq2005-10-21htmlentities modifier
#5876BogusBug2005-11-05toJavascript not working on post request
#5899No FeedbackBug2005-11-08Assigning a string array don't work
#6058BogusBug2005-11-24setting xhtml-style checked attribute changes value attribute
#6074ClosedBug2005-11-25misspelled variable
#6152ClosedBug2005-12-05error preparing options for select field
#6212ClosedReq2005-12-09can't use foreach with a method call
#6287Wont fixBug2005-12-19problems with __autoload
#6723BogusBug1.2.42006-02-08Flexy and Translation2 issues
#6774No FeedbackBug1.2.42006-02-13nameuses repeats values for text inputs
#6799VerifiedReq1.2.42006-02-16overzealous quoting of strings
#7140BogusReq1.2.42006-03-17multiple flexy:raw
#7483ClosedReq2006-04-25subtemplating support
#7609ClosedReq1.2.42006-05-12individual compilers required
#7620No FeedbackBug1.2.42006-05-13Flexy compiler tries to write out of copiled dir
#7628ClosedBug1.2.42006-05-15Translation2 Problem: Flexy Standard Compiler want new -> should be factory
#7867BogusReq2006-06-11Select multiple with multiples options selected
#7926BogusBug1.2.42006-06-16__autoload() attempts to load non-existing Flexy classes
#8008ClosedReq1.2.42006-06-26flexy:include should accept variables
#8064VerifiedReq1.2.42006-06-29toJavascript deletes javascript
#8113ClosedDoc2006-07-04Example does not work on windows
#9157ClosedBug1.2.52006-10-25Native language characters problem
#9336ClosedReq1.2.52006-11-15use of deprecated method
#9436ClosedReq1.2.52006-11-24url_rewrite doesn't work for background
#9591ClosedReq1.2.52006-12-09a patch to allow radiobuttons not to have id
#9642ClosedDoc1.2.52006-12-17Textares do not work within flexy:include
#9717No FeedbackBug1.2.52007-01-01Does not work under safe mode
#10001ClosedBug1.2.52007-02-01Dissapearing last row
#10002ClosedBug1.2.52007-02-01setData using array as paramether does not work
#10123AnalyzedReq1.2.52007-02-19Multiple indirection, i.e. a.b().c() etc
#10248OpenReq1.2.52007-03-02Additional Flexy Attributes
#10758BogusBug1.2.52007-04-17cache files *.gettext.serial creation ignores flexy:start Attribute
#10830AssignedReq1.2.52007-04-24*.gettext.serial string extraction not complete
#11740ClosedReq1.2.52007-08-02Change to tag / compile.
#11741ClosedReq1.2.52007-08-02New Methods on Element
#11751ClosedBugCVS2007-08-03E_NOTICEs in CustomFlexyAttributes.php
#11800ClosedBug1.2.52007-08-08Compilers use setlocale(LC_ALL,)
#12030FeedbackReq1.2.52007-09-12Add toJson tag
#12035ClosedDoc1.2.52007-09-12setAttributes function lacks the final "s"
#12036ClosedReq1.2.52007-09-12Flexy add closing tags to tags that aren't img or input
#12265ClosedReq1.2.52007-10-17support for 'label' element in HTML_Template_Flexy_Element
#12515VerifiedReq1.2.52007-11-23can't put param from foreach into quoted method call
#12685ClosedDoc2007-12-13User note that is a documentation problem
#12686VerifiedReq1.2.52007-12-14input tag: htmlspecialchars is applied twice to value="{xxx}"
#13010ClosedBug1.3.02008-01-30Missing HTML/Template/Flexy/Compiler/Flexy/CustomFlexyAttributes.php
#13016ClosedBug1.3.12008-01-31strange compiled template
#13022ClosedBug1.3.22008-01-31E_STRICT not defined in PHP4
#13028OpenBug1.3.22008-01-31Chackboxes with flexy:nameuses in PHP4
#13076ClosedReq1.3.22008-02-06Use of Deprecated function is_a()
#13179ClosedBug1.3.22008-02-22error_reporting() set error
#13396VerifiedDoc1.3.32008-03-15Add flexy:include to end-user documentation
#13419ClosedBug1.3.32008-03-18Compile Bug
#13420BogusBug1.3.32008-03-18Docytype Token Error
#13887ClosedReq1.3.42008-05-13Allow use of __call in custom plugin
#13888DuplicateReq1.3.42008-05-13Allow use of __call in custom plugin
#13900ClosedDoc2008-05-14User note that is a documentation problem
#14035OpenBugCVS2008-05-31flexy:replace, etc. don't handle modifiers
#14105ClosedBugCVS2008-06-08Empty element tag ending with /> and flexy:replace
#14893ClosedBugCVS2008-10-27Unit tests fail - expected results need updating
#14894AnalyzedReqCVS2008-10-27Regression: Test for Bug #2959 is broken
#14895ClosedBugCVS2008-10-27test_plugin_modifiers.html.phpt relies on local environment
#14899ClosedBug1.3.42008-10-27flexy:xhtml ignored when self closing tags
#14984ClosedBug1.3.42008-11-10Missing parameter in class_exists()
#15263ClosedBug1.3.42008-12-06Values and attributes affect more than one element with flexy:nameuses
#15272ClosedBug1.3.42008-12-07Checkboxes with arrays get wrong names and attributes with flexy:nameuses
#15279ClosedBug1.3.42008-12-09checkbox->setValue sets "checked" in a strange way
#15291AnalyzedReqCVS2008-12-10Test results vs short open tags (parse error)
#15874ClosedReqCVS2009-02-03Some errors by Compiler_Flexy_Tag have no filename
#15946AnalyzedReq2009-02-25Proposal: multiple purpose templates by extending flexy:start attribute
#15951DuplicateReq2009-02-26Method Chaining
#15953DuplicateReq2009-02-26Method Chaining
#15958FeedbackReq2009-02-27Function composition
#15961ClosedBug2009-02-28Custom flexy attribute is ignored if followed by other attributes
#16026ClosedBug1.3.62009-03-12Wrong use of is_callable
#16121FeedbackReq1.3.92009-04-18Foreach loop to indicate first/last iteration
#16554ClosedReq1.3.92009-08-29Option to turn-off template compilation
#16978ClosedBugUnknown2010-01-07Non-ASCII variables should be allowed in templetes.
#17021FeedbackBugUnknown2010-01-21getting fatal error, only on certain host
#17139BogusReq1.3.92010-02-19nested array properties are not supported
#17209BogusBug1.3.92010-03-10cannot use function with array value in attributes for flexy:nameuses
#17390No FeedbackBug1.3.92010-05-12flexy:nameuses don't replace id anymore
#17529BogusDoc1.3.102010-06-28Poor Documentation
#18392ClosedReq1.3.112011-03-23Translation2 data driver
#18509ClosedReq1.3.112011-05-06HTML_Template_Flexy_Token::factory
#18763ClosedBug1.3.112011-08-28PHP 5.3.7 is_a behavior change breaks HTML_Template_Flexy
#18985ClosedBugSVN2011-11-13Notice: Trying to get property of non-object
#19880FeedbackBug1.3.122013-04-02Error in Flexy Radio Buttons
#20443ClosedReq1.3.122014-11-21Release Request
#20510ClosedBug1.3.132015-03-03PHP 5 warnings & notices
#23740ClosedBug1.3.132018-03-02PHP 7.x compatability problem
#23741ClosedBug1.3.132018-03-02PHP 7.x compatability problem