<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.4" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Create your own HTML widgets with PHP</title>
	<link>http://phpit.net/article/create-html-widgets-php/</link>
	<description>PHPit has dozens of PHP articles, codesnippets and FAQ's.</description>
	<pubDate>Fri, 01 Aug 2008 23:54:13 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.4</generator>

	<item>
		<title>by: RosSoft &#187; Custom HTML Tags (WidgetHelper)</title>
		<link>http://phpit.net/article/create-html-widgets-php/#comment-4127</link>
		<pubDate>Tue, 20 Jun 2006 12:41:09 +0000</pubDate>
		<guid>http://phpit.net/article/create-html-widgets-php/#comment-4127</guid>
					<description>[...] &#60;?php/**&#160;* RepeaterWidget Helper&#160;* &#160;* Repeats the html within the tag &#60;repeater:repeater&#62;HTML&#60;/repeater:repeater&#62;&#160;* that contains the subtags &#60;repeater:key /&#62; and &#60;repeater:value /&#62;&#160;* It replaces the subtags with the key &#38; value from an associative array.&#160;* You must bind the widget to the array through&#160;* Example:&#160;* &#60;?php&#160;* $array=array(&#8217;Frodo&#8217;=&#62;&#8217;Elijah Wood&#8217;,'Aragorn&#8217;=&#62;&#8217;Viggo Mortensen&#8217;)&#160;* $repeaterWidget-&#62;bind(&#8217;cast&#8217;,$array))?&#62; * &#160;* &#60;repeater:repeater array=&#8217;cast&#8217;&#62;&#160;*&#160;&#160;&#160;&#160; &#60;b&#62;&#60;repeater:key/&#62;:&#60;/b&#62; &#60;repeater:value/&#62;&#160;*&#160;&#160;&#160;&#160; &#60;br/&#62;&#160;* &#60;/repeater&#62;&#160;* &#160;* Will output the html:&#160;*&#160;&#160;&#160;&#160; &#60;b&#62;Frodo:&#60;/b&#62;: Elijah Wood&#160;*&#160;&#160;&#160;&#160; &#60;br/&#62;&#160;*&#160;&#160;&#160;&#160; &#60;b&#62;Aragorn:&#60;/b&#62;: Viggo Mortensen&#160;*&#160;&#160;&#160;&#160; &#60;br/&#62;&#160;*&#160;* @author RosSoft&#160;* @version 0.1&#160;* @license MIT&#160;* &#160;* @link http://phpit.net/article/create-html-widgets-php/4/ &#160;*/require_once(dirname(__FILE__) . DS . &#8216;widget_helper.php&#8217;);class RepeaterWidgetHelper extends WidgetHelper{&#160;&#160;&#160; //main tags name =&#62; array subtags&#160;&#160;&#160; var $tag=array(&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#8216;repeater:repeater&#8217;=&#62;array(&#8217;repeater:key&#8217;,'repeater:value&#8217;)&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; );&#160;&#160;&#160; &#160;&#160;&#160; function tag_repeater_repeater($attr,$inner_html)&#160;&#160;&#160; {&#160;&#160;&#160; &#160;&#160;&#160; $array=$this-&#62;_get_bound($attr[&#8217;array&#8217;]);&#160;&#160;&#160; &#160;&#160;&#160; [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] &lt;?php/**&nbsp;* RepeaterWidget Helper&nbsp;* &nbsp;* Repeats the html within the tag &lt;repeater:repeater&gt;HTML&lt;/repeater:repeater&gt;&nbsp;* that contains the subtags &lt;repeater:key /&gt; and &lt;repeater:value /&gt;&nbsp;* It replaces the subtags with the key &amp; value from an associative array.&nbsp;* You must bind the widget to the array through&nbsp;* Example:&nbsp;* &lt;?php&nbsp;* $array=array(&#8217;Frodo&#8217;=&gt;&#8217;Elijah Wood&#8217;,&#8217;Aragorn&#8217;=&gt;&#8217;Viggo Mortensen&#8217;)&nbsp;* $repeaterWidget-&gt;bind(&#8217;cast&#8217;,$array))?&gt; * &nbsp;* &lt;repeater:repeater array=&#8217;cast&#8217;&gt;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp; &lt;b&gt;&lt;repeater:key/&gt;:&lt;/b&gt; &lt;repeater:value/&gt;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp; &lt;br/&gt;&nbsp;* &lt;/repeater&gt;&nbsp;* &nbsp;* Will output the html:&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp; &lt;b&gt;Frodo:&lt;/b&gt;: Elijah Wood&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp; &lt;br/&gt;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp; &lt;b&gt;Aragorn:&lt;/b&gt;: Viggo Mortensen&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp; &lt;br/&gt;&nbsp;*&nbsp;* @author RosSoft&nbsp;* @version 0.1&nbsp;* @license MIT&nbsp;* &nbsp;* @link <a href='/article/create-html-widgets-php/4/' rel='nofollow'>http://phpit.net/article/create-html-widgets-php/4/</a> &nbsp;*/require_once(dirname(__FILE__) . DS . &#8216;widget_helper.php&#8217;);class RepeaterWidgetHelper extends WidgetHelper{&nbsp;&nbsp;&nbsp; //main tags name =&gt; array subtags&nbsp;&nbsp;&nbsp; var $tag=array(&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &#8216;repeater:repeater&#8217;=&gt;array(&#8217;repeater:key&#8217;,&#8217;repeater:value&#8217;)&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; );&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; function tag_repeater_repeater($attr,$inner_html)&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $array=$this-&gt;_get_bound($attr[&#8217;array&#8217;]);&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&#8230;]
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
