Permalink
Browse files

Add new convenience method for writing <param name="foo" value="bar" />

writeParamElementWithName:value:
  • Loading branch information...
1 parent a0a4dce commit 0bc7e19aca9f70021fc9b2b0c64538452cc03a2a Dan Wood committed Aug 11, 2010
Showing with 13 additions and 0 deletions.
  1. +3 −0 KSHTMLWriter.h
  2. +10 −0 KSHTMLWriter.m
View
@@ -101,6 +101,9 @@
- (void)startJavascriptCDATA;
- (void)endJavascriptCDATA;
+#pragma mark Param
+
+- (void)writeParamElementWithName:(NSString *)name value:(NSString *)value;
#pragma mark Style
- (void)writeStyleElementWithCSSString:(NSString *)css;
View
@@ -238,6 +238,16 @@ - (void)endJavascriptCDATA;
[self writeString:@" */\n"];
}
+#pragma mark Param
+
+- (void)writeParamElementWithName:(NSString *)name value:(NSString *)value;
+{
+ if (type) [self pushElementAttribute:@"name" value:name];
+ if (type) [self pushElementAttribute:@"value" value:value];
+ [self startElement:@"param"];
+ [self endElement];
+}
+
#pragma mark Style
- (void)writeStyleElementWithCSSString:(NSString *)css;

0 comments on commit 0bc7e19

Please sign in to comment.