in reply to Re^12: Thanks to Ikegami, Chromatic & Corion
in thread Thanks to Ikegami, Chromatic & Corion
I tend not to put any HTML into the plugin code, but instead send it to the plugin from the document level.
<ul> <some_list_creating_plugin> <li><some_marker></li> </some_list_creating_plugin> </ul> some_list_creating_plugin => sub { my @list = ['foo','bar','baz']; my $mask = $_[0]; my $result; foreach my $item (@list) { my $maskCopy = $mask; $maskCopy =~ s@<some_marker>@$item@gs; push (@results, $maskCopy); } return join (@results); } output ------ <ul> <li>foo</li> <li>bar</li> <li>baz</li> </ul>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^14: Thanks to Ikegami, Chromatic & Corion
by ikegami (Patriarch) on Nov 03, 2011 at 01:54 UTC | |
by Logicus (Initiate) on Nov 03, 2011 at 02:17 UTC | |
by ikegami (Patriarch) on Nov 03, 2011 at 02:31 UTC | |
|