[limb-issues] Commented: (WACT-4) Move required_attributes, enclosing_tag and allow_selfnesting into tags annotation text
Sergey Yudin (JIRA)
jira at limb-project.com
Wed Oct 18 15:36:44 MSD 2006
[ http://jira.limb-project.com/browse/WACT-4?page=comments#action_10029 ]
Sergey Yudin commented on WACT-4:
---------------------------------
Here is the list of new tag annotation parser hints:
@tag - tag name like core:include, form, list:list etc
@req_attributes - Name a list of attributes (with constant values or with dynamic expressions) that are required to be present in template. If such an attribute is missed - an expection is raised.
@req_req_const_attributes - Name a list of attributes with constant values (those values can be determined at compile time) that are required to be present in template. If such an attribute is missed - an expection is raised.
@forbid_parsing - Tells compiler not to parse contents of a tag and treat all contents as simple text. Used in <core:literal> tag for example. Use this annotation hint without any value.
@parent_tag_class ParentTagClassName - Tells compiler to search in compile tree a parent tag of ParentTagClassName. If such a tag is not found - exception is raised. If this annotation hint is not defined - this restriction is not applied.
@restrict_self_nesting - Tells compiler to prevent situation when tag have the same tags among it's children. By default compiler does not restrict self nesting. Use this annotation hint without any value
@forbid_end_tag - Default value is "false" if the hint is skipped what means every tag must have a closing tag by default. Use this annotation hint without any value
@runat client|server (was @location) tells compiler if tag should be parsed. Usefull for HTML tag that have can have a runtime component (say RuntimeComponentHTML tags like <input>, <button> etc.). Default value is server if the hint is skipped
@inherit_runat_from TagClassName (was known_parent) - tells if tag can interit runat attribute from a parent tag of TagClassName.
@suppress_attributes attr1_name [attr2_name...] (was @attributes) - tell RuntimeComponentHTMLTag to suppress some attributes while rendering tag at runtime.
> Move required_attributes, enclosing_tag and allow_selfnesting into tags annotation text
> ---------------------------------------------------------------------------------------
>
> Key: WACT-4
> URL: http://jira.limb-project.com/browse/WACT-4
> Project: WACT
> Issue Type: Improvement
> Reporter: Sergey Yudin
> Assigned To: Sergey Yudin
> Priority: Minor
>
> After some modifications in CompilerTag you can describe required tag attributes using protected $required_attributes array property of the tag, e.g.:
> protected $required_attributes = array('file');
> This check is very primitive, it checks if the tag has such attribute and attribute has a constant value. It's ok for most of the cases. If you require attribute to have a particular value (e.g. you need to generate different code if attribute has a constant value or not) you should override preParse() method of the tag.
> I think it would be great to improve tag dictionary functionality and to allow describe required attributes in tag annotation zone.
> I also think we should implement both @req_attribute as well as @req_const_attribute to allow attribute existing check and attribute existing with constant value check.
> Moveover it would be nice to implement @allow_self_nesting flag and @parent_tag annotation fields as well. This will allow us to remove most of CheckNestingLevel() methods from tags.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.limb-project.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the limb-issues
mailing list