Carrot

 view release on metacpan or  search on metacpan

lib/Carrot/Productivity/Text/Placeholder/Templague./documentation/Templague-en.pod  view on Meta::CPAN

=pod

=head1 NAME

Carrot::Productivity::Text::Placeholder::Templague - compositions of placeholders

=head1 SYNOPSIS

	require Data::Dumper;

	$class_names->provide(
		my $templague_class = '::Productivity::Text::Placeholder::Templague');

	my %values = (
		'cond_some_value' => '99'
	);
	my $templague = $templague_class->constructor(
		[[my $result = '::SQL::Result'],
		[my $generic = '::Generic',
		my $statement = '::SQL::Statement']]);
	$result->placeholder_re('^fld_(\w+)$');
	$statement->placeholder_re('^cond_(\w+)$');
	$generic->add_placeholder('field_list',
		$result->field_list);

	$templague->compile(0,
		'<td>[=fld_some_name=]</td>
		<td>[=fld_other_name=]</td>');
	$templague->compile(1,
		'SELECT [=field_list=]
		FROM some_table
		WHERE some_field = [=cond_some_value=]');
	my $sql = $templague->execute(1);
	my $value_names = $statement->fields;

	my @values = map($values{$_}, @{$value_names});
	#my $rows = $dbh->selectall_arrayref($sql, {}, @values);
	my $rows = [[4..6], [qw(A B C)]];
	$rnd->format($rows);

	print Dumper($statement, \@values, $rows);

=head1 DESCRIPTION

Carrot::Productivity::Text::Placeholder::Templague::SQL::Retrieval_n_Display takes a HTML format and a SQL statement format and produces a table listing from it. It's an example how to build an templague from placeholder groups.

=head1 KNOWN BUGS AND LIMITATIONS

This is the first public release.

=head1 AUTHOR

Winfried Trumper E<lt>pub+perl(a)wt.tuxomania.netE<gt>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2011 Winfried Trumper

This module is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.

=cut



( run in 2.852 seconds using v1.01-cache-2.11-cpan-5b529ec07f3 )